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
9458545c
Commit
9458545c
authored
Aug 16, 2012
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:Sankore/Sankore-3.1
parents
694e6e5a
28eec6b1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
77 additions
and
2 deletions
+77
-2
UBCFFSubsetAdaptor.cpp
src/adaptors/UBCFFSubsetAdaptor.cpp
+71
-2
UBCFFSubsetAdaptor.h
src/adaptors/UBCFFSubsetAdaptor.h
+4
-0
UBSvgSubsetAdaptor.cpp
src/adaptors/UBSvgSubsetAdaptor.cpp
+2
-0
No files found.
src/adaptors/UBCFFSubsetAdaptor.cpp
View file @
9458545c
...
...
@@ -32,6 +32,7 @@
#include "domain/UBGraphicsTextItem.h"
#include "domain/UBGraphicsTextItemDelegate.h"
#include "domain/UBGraphicsWidgetItem.h"
#include "domain/UBGraphicsGroupContainerItem.h"
#include "frameworks/UBFileSystemUtils.h"
...
...
@@ -128,8 +129,9 @@ bool UBCFFSubsetAdaptor::ConvertCFFFileToUbz(QString &cffSourceFile, UBDocumentP
return
result
;
}
UBCFFSubsetAdaptor
::
UBCFFSubsetReader
::
UBCFFSubsetReader
(
UBDocumentProxy
*
proxy
,
QFile
*
content
)
:
mProxy
(
proxy
)
UBCFFSubsetAdaptor
::
UBCFFSubsetReader
::
UBCFFSubsetReader
(
UBDocumentProxy
*
proxy
,
QFile
*
content
)
:
mProxy
(
proxy
)
,
mGSectionContainer
(
NULL
)
{
int
errorLine
,
errorColumn
;
QString
errorStr
;
...
...
@@ -168,6 +170,8 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parse()
bool
UBCFFSubsetAdaptor
::
UBCFFSubsetReader
::
parseGSection
(
const
QDomElement
&
element
)
{
mGSectionContainer
=
new
UBGraphicsGroupContainerItem
();
QDomElement
currentSvgElement
=
element
.
firstChildElement
();
while
(
!
currentSvgElement
.
isNull
())
{
if
(
!
parseSvgElement
(
currentSvgElement
))
...
...
@@ -176,6 +180,16 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseGSection(const QDomElement &ele
currentSvgElement
=
currentSvgElement
.
nextSiblingElement
();
}
if
(
mGSectionContainer
->
childItems
().
count
())
{
mCurrentScene
->
addGroup
(
mGSectionContainer
);
}
else
{
delete
mGSectionContainer
;
mGSectionContainer
=
NULL
;
}
return
true
;
}
bool
UBCFFSubsetAdaptor
::
UBCFFSubsetReader
::
parseSvgSwitchSection
(
const
QDomElement
&
element
)
...
...
@@ -247,6 +261,11 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgRect(const QDomElement &elem
repositionSvgItem
(
svgItem
,
width
,
height
,
x1
,
y1
,
transform
);
hashSceneItem
(
element
,
svgItem
);
if
(
mGSectionContainer
)
{
addItemToGSection
(
svgItem
);
}
delete
generator
;
return
true
;
...
...
@@ -293,6 +312,11 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgEllipse(const QDomElement &e
repositionSvgItem
(
svgItem
,
rx
*
2
,
ry
*
2
,
cx
-
2
*
rx
,
cy
+
ry
,
transform
);
hashSceneItem
(
element
,
svgItem
);
if
(
mGSectionContainer
)
{
addItemToGSection
(
svgItem
);
}
delete
generator
;
return
true
;
...
...
@@ -375,6 +399,11 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgPolygon(const QDomElement &e
repositionSvgItem
(
svgItem
,
width
+
strokeWidth
,
height
+
strokeWidth
,
x1
-
strokeWidth
/
2
+
transform
.
m31
(),
y1
+
strokeWidth
/
2
+
transform
.
m32
(),
transform
);
hashSceneItem
(
element
,
svgItem
);
if
(
mGSectionContainer
)
{
addItemToGSection
(
svgItem
);
}
delete
generator
;
return
true
;
...
...
@@ -454,6 +483,11 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgPolyline(const QDomElement &
repositionSvgItem
(
svgItem
,
width
+
strokeWidth
,
height
+
strokeWidth
,
x1
+
transform
.
m31
()
-
strokeWidth
/
2
,
y1
+
transform
.
m32
()
+
strokeWidth
/
2
,
transform
);
hashSceneItem
(
element
,
svgItem
);
if
(
mGSectionContainer
)
{
addItemToGSection
(
svgItem
);
}
delete
generator
;
return
true
;
...
...
@@ -593,6 +627,11 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgText(const QDomElement &elem
repositionSvgItem
(
svgItem
,
width
,
height
,
x
+
transform
.
m31
(),
y
+
transform
.
m32
(),
transform
);
hashSceneItem
(
element
,
svgItem
);
if
(
mGSectionContainer
)
{
addItemToGSection
(
svgItem
);
}
delete
generator
;
return
true
;
}
...
...
@@ -712,6 +751,11 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgTextarea(const QDomElement &
repositionSvgItem
(
svgItem
,
width
,
height
,
x
+
transform
.
m31
(),
y
+
transform
.
m32
(),
transform
);
hashSceneItem
(
element
,
svgItem
);
if
(
mGSectionContainer
)
{
addItemToGSection
(
svgItem
);
}
return
true
;
}
bool
UBCFFSubsetAdaptor
::
UBCFFSubsetReader
::
parseSvgImage
(
const
QDomElement
&
element
)
...
...
@@ -749,6 +793,11 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgImage(const QDomElement &ele
repositionSvgItem
(
pixItem
,
width
,
height
,
x
+
transform
.
m31
(),
y
+
transform
.
m32
(),
transform
);
hashSceneItem
(
element
,
pixItem
);
if
(
mGSectionContainer
)
{
addItemToGSection
(
pixItem
);
}
return
true
;
}
bool
UBCFFSubsetAdaptor
::
UBCFFSubsetReader
::
parseSvgFlash
(
const
QDomElement
&
element
)
...
...
@@ -791,6 +840,11 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgFlash(const QDomElement &ele
repositionSvgItem
(
flashItem
,
width
,
height
,
x
+
transform
.
m31
(),
y
+
transform
.
m32
(),
transform
);
hashSceneItem
(
element
,
flashItem
);
if
(
mGSectionContainer
)
{
addItemToGSection
(
flashItem
);
}
return
true
;
}
...
...
@@ -829,6 +883,11 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgAudio(const QDomElement &ele
repositionSvgItem
(
audioItem
,
audioItem
->
boundingRect
().
width
(),
audioItem
->
boundingRect
().
height
(),
x
+
transform
.
m31
(),
y
+
transform
.
m32
(),
transform
);
hashSceneItem
(
element
,
audioItem
);
if
(
mGSectionContainer
)
{
addItemToGSection
(
audioItem
);
}
return
true
;
}
bool
UBCFFSubsetAdaptor
::
UBCFFSubsetReader
::
parseSvgVideo
(
const
QDomElement
&
element
)
...
...
@@ -867,6 +926,11 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgVideo(const QDomElement &ele
repositionSvgItem
(
videoItem
,
videoItem
->
boundingRect
().
width
(),
videoItem
->
boundingRect
().
height
(),
x
+
transform
.
m31
(),
y
+
transform
.
m32
(),
transform
);
hashSceneItem
(
element
,
videoItem
);
if
(
mGSectionContainer
)
{
addItemToGSection
(
videoItem
);
}
return
true
;
}
...
...
@@ -877,6 +941,11 @@ void UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgSectionAttr(const QDomElemen
svgSection
.
attribute
(
aHeight
).
toInt
());
}
void
UBCFFSubsetAdaptor
::
UBCFFSubsetReader
::
addItemToGSection
(
QGraphicsItem
*
item
)
{
mGSectionContainer
->
addToGroup
(
item
);
}
void
UBCFFSubsetAdaptor
::
UBCFFSubsetReader
::
hashSceneItem
(
const
QDomElement
&
element
,
UBGraphicsItem
*
item
)
{
// adding element pointer to hash to refer if needed
...
...
src/adaptors/UBCFFSubsetAdaptor.h
View file @
9458545c
...
...
@@ -35,6 +35,7 @@ class QGraphicsItem;
class
QTextBlockFormat
;
class
QTextCharFormat
;
class
QTextCursor
;
class
UBGraphicsStrokesGroup
;
class
UBCFFSubsetAdaptor
...
...
@@ -66,6 +67,8 @@ private:
QPointF
mViewBoxCenter
;
QSize
mSize
;
QPointF
mShiftVector
;
bool
mSvgGSectionIsOpened
;
UBGraphicsGroupContainerItem
*
mGSectionContainer
;
private
:
QDomDocument
mDOMdoc
;
...
...
@@ -73,6 +76,7 @@ private:
QHash
<
QString
,
UBGraphicsItem
*>
persistedItems
;
QDir
mTmpFlashDir
;
void
addItemToGSection
(
QGraphicsItem
*
item
);
bool
hashElements
();
void
addExtentionsToHash
(
QDomElement
*
parent
,
QDomElement
*
topGroup
);
...
...
src/adaptors/UBSvgSubsetAdaptor.cpp
View file @
9458545c
...
...
@@ -396,6 +396,7 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
if
(
!
mScene
)
{
mScene
=
new
UBGraphicsScene
(
mProxy
);
mScene
->
setURStackEnable
(
false
);
}
// introduced in UB 4.2
...
...
@@ -1013,6 +1014,7 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
delete
annotationGroup
;
}
mScene
->
setURStackEnable
(
true
);
return
mScene
;
}
...
...
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