Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lifo
Nicolas Ollinger
OpenBoard
Commits
a77937cd
Commit
a77937cd
authored
May 11, 2012
by
Ivan Ilyin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
export ubz is as previous again
parent
687da649
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
115 additions
and
125 deletions
+115
-125
UBSvgSubsetAdaptor.cpp
src/adaptors/UBSvgSubsetAdaptor.cpp
+106
-115
UBSvgSubsetAdaptor.h
src/adaptors/UBSvgSubsetAdaptor.h
+0
-1
UBGraphicsPolygonItem.cpp
src/domain/UBGraphicsPolygonItem.cpp
+8
-8
UBGraphicsPolygonItem.h
src/domain/UBGraphicsPolygonItem.h
+1
-1
No files found.
src/adaptors/UBSvgSubsetAdaptor.cpp
View file @
a77937cd
...
...
@@ -1041,162 +1041,153 @@ bool UBSvgSubsetAdaptor::UBSvgSubsetWriter::persistScene()
openStroke
=
0
;
}
UBGraphics
GroupContainerItem
*
groupItem
=
qgraphicsitem_cast
<
UBGraphicsGroupContainerItem
*>
(
item
);
UBGraphics
PixmapItem
*
pixmapItem
=
qgraphicsitem_cast
<
UBGraphicsPixmapItem
*>
(
item
);
if
(
groupItem
&&
grou
pItem
->
isVisible
())
if
(
pixmapItem
&&
pixma
pItem
->
isVisible
())
{
qDebug
()
<<
"came across the group during the parsing"
;
pixmapItemToLinkedImage
(
pixmapItem
)
;
continue
;
}
parseCommonItems
(
item
);
}
UBGraphicsSvgItem
*
svgItem
=
qgraphicsitem_cast
<
UBGraphicsSvgItem
*>
(
item
);
if
(
openStroke
)
{
mXmlWriter
.
writeEndElement
();
groupHoldsInfo
=
false
;
openStroke
=
0
;
}
if
(
svgItem
&&
svgItem
->
isVisible
())
{
svgItemToLinkedSvg
(
svgItem
);
continue
;
}
mXmlWriter
.
writeEndDocument
();
QString
fileName
=
mDocumentPath
+
UBFileSystemUtils
::
digitFileFormat
(
"/page%1.svg"
,
mPageIndex
+
1
);
QFile
file
(
fileName
);
UBGraphicsVideoItem
*
videoItem
=
qgraphicsitem_cast
<
UBGraphicsVideoItem
*>
(
item
);
if
(
!
file
.
open
(
QIODevice
::
WriteOnly
|
QIODevice
::
Truncate
))
{
qCritical
()
<<
"cannot open "
<<
fileName
<<
" for writing ..."
;
return
false
;
}
file
.
write
(
buffer
.
data
());
file
.
flush
();
file
.
close
();
if
(
videoItem
&&
videoItem
->
isVisible
())
{
videoItemToLinkedVideo
(
videoItem
);
continue
;
}
}
else
{
qDebug
()
<<
"ignoring unmodified page"
<<
mPageIndex
+
1
;
}
UBGraphicsAudioItem
*
audioItem
=
qgraphicsitem_cast
<
UBGraphicsAudioItem
*>
(
item
);
if
(
audioItem
&&
audioItem
->
isVisible
())
{
audioItemToLinkedAudio
(
audioItem
);
continue
;
}
return
true
;
}
UBGraphicsAppleWidgetItem
*
appleWidgetItem
=
qgraphicsitem_cast
<
UBGraphicsAppleWidgetItem
*>
(
item
);
bool
UBSvgSubsetAdaptor
::
UBSvgSubsetWriter
::
parseCommonItems
(
QGraphicsItem
*
item
)
{
UBGraphicsPixmapItem
*
pixmapItem
=
qgraphicsitem_cast
<
UBGraphicsPixmapItem
*>
(
item
);
if
(
appleWidgetItem
&&
appleWidgetItem
->
isVisible
())
{
graphicsAppleWidgetToSvg
(
appleWidgetItem
);
continue
;
}
if
(
pixmapItem
&&
pixmapItem
->
isVisible
())
{
pixmapItemToLinkedImage
(
pixmapItem
);
return
true
;
}
UBGraphicsW3CWidgetItem
*
w3cWidgetItem
=
qgraphicsitem_cast
<
UBGraphicsW3CWidgetItem
*>
(
item
);
UBGraphicsSvgItem
*
svgItem
=
qgraphicsitem_cast
<
UBGraphicsSvgItem
*>
(
item
);
if
(
w3cWidgetItem
&&
w3cWidgetItem
->
isVisible
())
{
graphicsW3CWidgetToSvg
(
w3cWidgetItem
);
continue
;
}
if
(
svgItem
&&
svgItem
->
isVisible
())
{
svgItemToLinkedSvg
(
svgItem
);
return
true
;
}
UBGraphicsPDFItem
*
pdfItem
=
qgraphicsitem_cast
<
UBGraphicsPDFItem
*>
(
item
);
UBGraphicsVideoItem
*
videoItem
=
qgraphicsitem_cast
<
UBGraphicsVideoItem
*>
(
item
);
if
(
pdfItem
&&
pdfItem
->
isVisible
())
{
pdfItemToLinkedPDF
(
pdfItem
);
continue
;
}
if
(
videoItem
&&
videoItem
->
isVisible
())
{
videoItemToLinkedVideo
(
videoItem
);
return
true
;
}
UBGraphicsTextItem
*
textItem
=
qgraphicsitem_cast
<
UBGraphicsTextItem
*>
(
item
);
UBGraphicsAudioItem
*
audioItem
=
qgraphicsitem_cast
<
UBGraphicsAudioItem
*>
(
item
);
if
(
audioItem
&&
audioItem
->
isVisible
())
{
audioItemToLinkedAudio
(
audio
Item
);
return
tr
ue
;
}
if
(
textItem
&&
textItem
->
isVisible
())
{
textItemToSvg
(
text
Item
);
contin
ue
;
}
UBGraphicsAppleWidgetItem
*
appleWidgetItem
=
qgraphicsitem_cast
<
UBGraphicsAppleWidget
Item
*>
(
item
);
UBGraphicsCurtainItem
*
curtainItem
=
qgraphicsitem_cast
<
UBGraphicsCurtain
Item
*>
(
item
);
if
(
appleWidgetItem
&&
appleWidget
Item
->
isVisible
())
{
graphicsAppleWidgetToSvg
(
appleWidget
Item
);
return
tr
ue
;
}
if
(
curtainItem
&&
curtain
Item
->
isVisible
())
{
curtainItemToSvg
(
curtain
Item
);
contin
ue
;
}
UBGraphicsW3CWidgetItem
*
w3cWidgetItem
=
qgraphicsitem_cast
<
UBGraphicsW3CWidgetItem
*>
(
item
);
UBGraphicsRuler
*
ruler
=
qgraphicsitem_cast
<
UBGraphicsRuler
*>
(
item
);
if
(
w3cWidgetItem
&&
w3cWidgetItem
->
isVisible
())
{
graphicsW3CWidgetToSvg
(
w3cWidgetItem
);
return
tr
ue
;
}
if
(
ruler
&&
ruler
->
isVisible
())
{
rulerToSvg
(
ruler
);
contin
ue
;
}
UBGraphicsPDFItem
*
pdfItem
=
qgraphicsitem_cast
<
UBGraphicsPDFItem
*>
(
item
);
UBGraphicsCache
*
cache
=
qgraphicsitem_cast
<
UBGraphicsCache
*>
(
item
);
if
(
cache
&&
cache
->
isVisible
())
{
cacheToSvg
(
cache
);
continue
;
}
if
(
pdfItem
&&
pdfItem
->
isVisible
())
{
pdfItemToLinkedPDF
(
pdfItem
);
return
true
;
}
UBGraphicsCompass
*
compass
=
qgraphicsitem_cast
<
UBGraphicsCompass
*>
(
item
);
UBGraphicsTextItem
*
textItem
=
qgraphicsitem_cast
<
UBGraphicsTextItem
*>
(
item
);
if
(
compass
&&
compass
->
isVisible
())
{
compassToSvg
(
compass
);
continue
;
}
if
(
textItem
&&
textItem
->
isVisible
())
{
textItemToSvg
(
textItem
);
return
true
;
}
UBGraphicsProtractor
*
protractor
=
qgraphicsitem_cast
<
UBGraphicsProtractor
*>
(
item
);
UBGraphicsCurtainItem
*
curtainItem
=
qgraphicsitem_cast
<
UBGraphicsCurtainItem
*>
(
item
);
if
(
protractor
&&
protractor
->
isVisible
())
{
protractorToSvg
(
protractor
);
continue
;
}
if
(
curtainItem
&&
curtainItem
->
isVisible
())
{
curtainItemToSvg
(
curtainItem
);
return
true
;
}
UBGraphicsTriangle
*
triangle
=
qgraphicsitem_cast
<
UBGraphicsTriangle
*>
(
item
);
UBGraphicsRuler
*
ruler
=
qgraphicsitem_cast
<
UBGraphicsRuler
*>
(
item
);
if
(
triangle
&&
triangle
->
isVisible
())
{
triangleToSvg
(
triangle
);
continue
;
}
if
(
ruler
&&
ruler
->
isVisible
())
{
rulerToSvg
(
ruler
);
return
true
;
}
UBGraphicsGroupContainerItem
*
groupItem
=
qgraphicsitem_cast
<
UBGraphicsGroupContainerItem
*>
(
item
);
UBGraphicsCache
*
cache
=
qgraphicsitem_cast
<
UBGraphicsCache
*>
(
item
);
if
(
cache
&&
cache
->
isVisible
())
{
cacheToSvg
(
cache
)
;
return
true
;
}
if
(
groupItem
&&
groupItem
->
isVisible
())
{
qDebug
()
<<
"came across the group during the parsing"
;
continue
;
}
}
UBGraphicsCompass
*
compass
=
qgraphicsitem_cast
<
UBGraphicsCompass
*>
(
item
);
if
(
openStroke
)
{
mXmlWriter
.
writeEndElement
();
groupHoldsInfo
=
false
;
openStroke
=
0
;
}
if
(
compass
&&
compass
->
isVisible
())
{
compassToSvg
(
compass
);
return
true
;
}
mXmlWriter
.
writeEndDocument
();
QString
fileName
=
mDocumentPath
+
UBFileSystemUtils
::
digitFileFormat
(
"/page%1.svg"
,
mPageIndex
+
1
);
QFile
file
(
fileName
);
UBGraphicsProtractor
*
protractor
=
qgraphicsitem_cast
<
UBGraphicsProtractor
*>
(
item
);
if
(
!
file
.
open
(
QIODevice
::
WriteOnly
|
QIODevice
::
Truncate
))
{
qCritical
()
<<
"cannot open "
<<
fileName
<<
" for writing ..."
;
return
false
;
}
file
.
write
(
buffer
.
data
());
file
.
flush
();
file
.
close
();
if
(
protractor
&&
protractor
->
isVisible
())
{
protractorToSvg
(
protractor
);
return
true
;
}
UBGraphicsTriangle
*
triangle
=
qgraphicsitem_cast
<
UBGraphicsTriangle
*>
(
item
);
if
(
triangle
&&
triangle
->
isVisible
())
else
{
triangleToSvg
(
triangle
);
return
true
;
qDebug
()
<<
"ignoring unmodified page"
<<
mPageIndex
+
1
;
}
return
true
;
}
void
UBSvgSubsetAdaptor
::
UBSvgSubsetWriter
::
polygonItemToSvgLine
(
UBGraphicsPolygonItem
*
polygonItem
,
bool
groupHoldsInfo
)
{
mXmlWriter
.
writeStartElement
(
"line"
);
...
...
src/adaptors/UBSvgSubsetAdaptor.h
View file @
a77937cd
...
...
@@ -156,7 +156,6 @@ class UBSvgSubsetAdaptor
UBSvgSubsetWriter
(
UBDocumentProxy
*
proxy
,
UBGraphicsScene
*
pScene
,
const
int
pageIndex
);
bool
persistScene
();
bool
parseCommonItems
(
QGraphicsItem
*
item
);
virtual
~
UBSvgSubsetWriter
(){}
...
...
src/domain/UBGraphicsPolygonItem.cpp
View file @
a77937cd
...
...
@@ -189,18 +189,18 @@ void UBGraphicsPolygonItem::paint ( QPainter * painter, const QStyleOptionGraphi
QGraphicsPolygonItem
::
paint
(
painter
,
option
,
widget
);
}
QPainterPath
UBGraphicsPolygonItem
::
shape
()
const
{
//
QPainterPath UBGraphicsPolygonItem::shape() const
//
{
QPainterPath
path
;
path
.
addRect
(
boundingRect
());
//
QPainterPath path;
//
path.addRect(boundingRect());
return
path
;
//
return path;
// static QPainterPath shapePath = QGraphicsPolygonItem::shape();
//
//
static QPainterPath shapePath = QGraphicsPolygonItem::shape();
// return shapePath;
}
//
//
return shapePath;
//
}
UBGraphicsScene
*
UBGraphicsPolygonItem
::
scene
()
...
...
src/domain/UBGraphicsPolygonItem.h
View file @
a77937cd
...
...
@@ -118,7 +118,7 @@ class UBGraphicsPolygonItem : public QGraphicsPolygonItem, public UBItem
protected
:
void
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
);
QPainterPath
shape
()
const
;
//
QPainterPath shape () const;
private
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment