Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Krita
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tusooa Zhu
Krita
Commits
1d5cc0d5
Commit
1d5cc0d5
authored
Jul 07, 2007
by
Jan Hambrecht
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implemented loading of shape background (at least solid and hatch fill)
svn path=/trunk/koffice/; revision=684964
parent
1ca53b4f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
0 deletions
+33
-0
libs/flake/KoShape.cpp
libs/flake/KoShape.cpp
+30
-0
libs/flake/KoShape.h
libs/flake/KoShape.h
+3
-0
No files found.
libs/flake/KoShape.cpp
View file @
1d5cc0d5
...
...
@@ -42,6 +42,7 @@
#include <KoGenStyle.h>
#include <KoUnit.h>
#include <KoOasisStyles.h>
#include <KoOasisLoadingContext.h>
#include <QPainter>
#include <QVariant>
...
...
@@ -651,6 +652,8 @@ bool KoShape::loadOdfAttributes( const KoXmlElement & element, KoShapeLoadingCon
// TODO what do we do in the case the z-index is not there then the order in the doc
// is the the order of the z-index
}
setBackground
(
loadOdfFill
(
element
,
context
)
);
}
if
(
attributes
&
OdfSize
)
{
...
...
@@ -675,6 +678,33 @@ bool KoShape::loadOdfAttributes( const KoXmlElement & element, KoShapeLoadingCon
return
true
;
}
QBrush
KoShape
::
loadOdfFill
(
const
KoXmlElement
&
element
,
KoShapeLoadingContext
&
context
)
{
KoStyleStack
&
styleStack
=
context
.
koLoadingContext
().
styleStack
();
QString
fill
;
if
(
element
.
hasAttributeNS
(
KoXmlNS
::
draw
,
"style-name"
)
)
{
// fill the style stack with the shapes style
context
.
koLoadingContext
().
fillStyleStack
(
element
,
KoXmlNS
::
draw
,
"style-name"
,
"graphic"
);
styleStack
.
setTypeProperties
(
"graphic"
);
if
(
styleStack
.
hasProperty
(
KoXmlNS
::
draw
,
"fill"
)
)
fill
=
styleStack
.
property
(
KoXmlNS
::
draw
,
"fill"
);
}
else
if
(
element
.
hasAttributeNS
(
KoXmlNS
::
presentation
,
"style-name"
)
)
{
// fill the style stack with the shapes style
context
.
koLoadingContext
().
fillStyleStack
(
element
,
KoXmlNS
::
presentation
,
"style-name"
,
"presentation"
);
styleStack
.
setTypeProperties
(
"presentation"
);
if
(
styleStack
.
hasProperty
(
KoXmlNS
::
presentation
,
"fill"
)
)
fill
=
styleStack
.
property
(
KoXmlNS
::
presentation
,
"fill"
);
}
if
(
fill
==
"solid"
||
fill
==
"hatch"
)
return
KoOasisStyles
::
loadOasisFillStyle
(
styleStack
,
fill
,
context
.
koLoadingContext
().
oasisStyles
()
);
return
QBrush
();
}
QMatrix
KoShape
::
parseOdfTransform
(
const
QString
&
transform
)
{
QMatrix
matrix
;
...
...
libs/flake/KoShape.h
View file @
1d5cc0d5
...
...
@@ -644,6 +644,9 @@ protected:
*/
QString
style
(
KoShapeSavingContext
&
context
)
const
;
/// Loads the fill style
QBrush
loadOdfFill
(
const
KoXmlElement
&
element
,
KoShapeLoadingContext
&
context
);
/* ** end loading saving */
...
...
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