Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
a07a6985
Kaydet (Commit)
a07a6985
authored
Haz 23, 2016
tarafından
Jan Holesovsky
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Introduce FillAutoStyle() method to reduce copy'n'paste.
Change-Id: Ibdb6ae15790cc117d3d8c41c57924f9b22e85cba
üst
535ac37c
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
72 deletions
+30
-72
SchXMLImportHelper.hxx
include/xmloff/SchXMLImportHelper.hxx
+3
-0
SchXMLAxisContext.cxx
xmloff/source/chart/SchXMLAxisContext.cxx
+2
-12
SchXMLChartContext.cxx
xmloff/source/chart/SchXMLChartContext.cxx
+4
-26
SchXMLImport.cxx
xmloff/source/chart/SchXMLImport.cxx
+17
-1
SchXMLLegendContext.cxx
xmloff/source/chart/SchXMLLegendContext.cxx
+1
-9
SchXMLPlotAreaContext.cxx
xmloff/source/chart/SchXMLPlotAreaContext.cxx
+3
-24
No files found.
include/xmloff/SchXMLImportHelper.hxx
Dosyayı görüntüle @
a07a6985
...
@@ -100,6 +100,9 @@ public:
...
@@ -100,6 +100,9 @@ public:
void
SetAutoStylesContext
(
SvXMLStylesContext
*
pAutoStyles
)
{
mpAutoStyles
=
pAutoStyles
;
}
void
SetAutoStylesContext
(
SvXMLStylesContext
*
pAutoStyles
)
{
mpAutoStyles
=
pAutoStyles
;
}
SvXMLStylesContext
*
GetAutoStylesContext
()
const
{
return
mpAutoStyles
;
}
SvXMLStylesContext
*
GetAutoStylesContext
()
const
{
return
mpAutoStyles
;
}
/// Fill in the autostyle.
void
FillAutoStyle
(
const
OUString
&
rAutoStyleName
,
const
css
::
uno
::
Reference
<
css
::
beans
::
XPropertySet
>&
rProp
);
const
css
::
uno
::
Reference
<
css
::
chart
::
XChartDocument
>&
GetChartDocument
()
const
css
::
uno
::
Reference
<
css
::
chart
::
XChartDocument
>&
GetChartDocument
()
{
return
mxChartDoc
;
}
{
return
mxChartDoc
;
}
...
...
xmloff/source/chart/SchXMLAxisContext.cxx
Dosyayı görüntüle @
a07a6985
...
@@ -219,18 +219,8 @@ void SchXMLAxisContext::CreateGrid( const OUString& sAutoStyleName, bool bIsMajo
...
@@ -219,18 +219,8 @@ void SchXMLAxisContext::CreateGrid( const OUString& sAutoStyleName, bool bIsMajo
// the line color is black as default, in the model it is a light gray
// the line color is black as default, in the model it is a light gray
xGridProp
->
setPropertyValue
(
"LineColor"
,
xGridProp
->
setPropertyValue
(
"LineColor"
,
uno
::
makeAny
(
COL_BLACK
));
uno
::
makeAny
(
COL_BLACK
));
if
(
!
sAutoStyleName
.
isEmpty
())
if
(
!
sAutoStyleName
.
isEmpty
())
{
m_rImportHelper
.
FillAutoStyle
(
sAutoStyleName
,
xGridProp
);
const
SvXMLStylesContext
*
pStylesCtxt
=
m_rImportHelper
.
GetAutoStylesContext
();
if
(
pStylesCtxt
)
{
const
SvXMLStyleContext
*
pStyle
=
pStylesCtxt
->
FindStyleChildContext
(
SchXMLImportHelper
::
GetChartFamilyID
(),
sAutoStyleName
);
if
(
pStyle
&&
dynamic_cast
<
const
XMLPropStyleContext
*>
(
pStyle
)
!=
nullptr
)
const_cast
<
XMLPropStyleContext
*>
(
static_cast
<
const
XMLPropStyleContext
*
>
(
pStyle
))
->
FillPropertySet
(
xGridProp
);
}
}
}
}
}
}
...
...
xmloff/source/chart/SchXMLChartContext.cxx
Dosyayı görüntüle @
a07a6985
...
@@ -364,19 +364,8 @@ void SchXMLChartContext::StartElement( const uno::Reference< xml::sax::XAttribut
...
@@ -364,19 +364,8 @@ void SchXMLChartContext::StartElement( const uno::Reference< xml::sax::XAttribut
}
}
// set auto-styles for Area
// set auto-styles for Area
uno
::
Reference
<
beans
::
XPropertySet
>
xProp
(
mrImportHelper
.
GetChartDocument
()
->
getArea
(),
uno
::
UNO_QUERY
);
uno
::
Reference
<
beans
::
XPropertySet
>
xProp
(
mrImportHelper
.
GetChartDocument
()
->
getArea
(),
uno
::
UNO_QUERY
);
if
(
xProp
.
is
())
mrImportHelper
.
FillAutoStyle
(
sAutoStyleName
,
xProp
);
{
const
SvXMLStylesContext
*
pStylesCtxt
=
mrImportHelper
.
GetAutoStylesContext
();
if
(
pStylesCtxt
)
{
const
SvXMLStyleContext
*
pStyle
=
pStylesCtxt
->
FindStyleChildContext
(
SchXMLImportHelper
::
GetChartFamilyID
(),
sAutoStyleName
);
if
(
pStyle
&&
dynamic_cast
<
const
XMLPropStyleContext
*>
(
pStyle
)
!=
nullptr
)
const_cast
<
XMLPropStyleContext
*>
(
static_cast
<
const
XMLPropStyleContext
*
>
(
pStyle
)
)
->
FillPropertySet
(
xProp
);
}
}
}
}
namespace
namespace
...
@@ -1183,19 +1172,8 @@ void SchXMLTitleContext::StartElement( const uno::Reference< xml::sax::XAttribut
...
@@ -1183,19 +1172,8 @@ void SchXMLTitleContext::StartElement( const uno::Reference< xml::sax::XAttribut
if
(
bHasXPosition
&&
bHasYPosition
)
if
(
bHasXPosition
&&
bHasYPosition
)
mxTitleShape
->
setPosition
(
aPosition
);
mxTitleShape
->
setPosition
(
aPosition
);
uno
::
Reference
<
beans
::
XPropertySet
>
xProp
(
mxTitleShape
,
uno
::
UNO_QUERY
);
uno
::
Reference
<
beans
::
XPropertySet
>
xProp
(
mxTitleShape
,
uno
::
UNO_QUERY
);
if
(
xProp
.
is
())
mrImportHelper
.
FillAutoStyle
(
msAutoStyleName
,
xProp
);
{
const
SvXMLStylesContext
*
pStylesCtxt
=
mrImportHelper
.
GetAutoStylesContext
();
if
(
pStylesCtxt
)
{
const
SvXMLStyleContext
*
pStyle
=
pStylesCtxt
->
FindStyleChildContext
(
SchXMLImportHelper
::
GetChartFamilyID
(),
msAutoStyleName
);
if
(
pStyle
&&
dynamic_cast
<
const
XMLPropStyleContext
*>
(
pStyle
)
!=
nullptr
)
const_cast
<
XMLPropStyleContext
*>
(
static_cast
<
const
XMLPropStyleContext
*
>
(
pStyle
)
)
->
FillPropertySet
(
xProp
);
}
}
}
}
}
}
...
...
xmloff/source/chart/SchXMLImport.cxx
Dosyayı görüntüle @
a07a6985
...
@@ -26,10 +26,11 @@
...
@@ -26,10 +26,11 @@
#include <rtl/ustrbuf.hxx>
#include <rtl/ustrbuf.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/processfactory.hxx>
#include <xmloff/nmspmap.hxx>
#include <xmloff/prstylei.hxx>
#include <xmloff/xmlnmspe.hxx>
#include <xmloff/xmlnmspe.hxx>
#include <xmloff/xmltoken.hxx>
#include <xmloff/xmltoken.hxx>
#include <xmloff/xmluconv.hxx>
#include <xmloff/xmluconv.hxx>
#include <xmloff/nmspmap.hxx>
#include <xmloff/xmlictxt.hxx>
#include <xmloff/xmlictxt.hxx>
#include <xmloff/xmlstyle.hxx>
#include <xmloff/xmlstyle.hxx>
#include <com/sun/star/task/XStatusIndicatorSupplier.hpp>
#include <com/sun/star/task/XStatusIndicatorSupplier.hpp>
...
@@ -140,6 +141,21 @@ SvXMLImportContext* SchXMLImportHelper::CreateChartContext(
...
@@ -140,6 +141,21 @@ SvXMLImportContext* SchXMLImportHelper::CreateChartContext(
return
pContext
;
return
pContext
;
}
}
void
SchXMLImportHelper
::
FillAutoStyle
(
const
OUString
&
rAutoStyleName
,
const
uno
::
Reference
<
beans
::
XPropertySet
>&
rProp
)
{
if
(
!
rProp
.
is
())
return
;
const
SvXMLStylesContext
*
pStylesCtxt
=
GetAutoStylesContext
();
if
(
pStylesCtxt
)
{
SvXMLStyleContext
*
pStyle
=
const_cast
<
SvXMLStyleContext
*>
(
pStylesCtxt
->
FindStyleChildContext
(
SchXMLImportHelper
::
GetChartFamilyID
(),
rAutoStyleName
));
if
(
XMLPropStyleContext
*
pPropStyle
=
dynamic_cast
<
XMLPropStyleContext
*>
(
pStyle
))
pPropStyle
->
FillPropertySet
(
rProp
);
}
}
// get various token maps
// get various token maps
const
SvXMLTokenMap
&
SchXMLImportHelper
::
GetDocElemTokenMap
()
const
SvXMLTokenMap
&
SchXMLImportHelper
::
GetDocElemTokenMap
()
...
...
xmloff/source/chart/SchXMLLegendContext.cxx
Dosyayı görüntüle @
a07a6985
...
@@ -198,15 +198,7 @@ void SchXMLLegendContext::StartElement( const uno::Reference< xml::sax::XAttribu
...
@@ -198,15 +198,7 @@ void SchXMLLegendContext::StartElement( const uno::Reference< xml::sax::XAttribu
xLegendProps
->
setPropertyValue
(
"FillStyle"
,
uno
::
makeAny
(
drawing
::
FillStyle_NONE
));
xLegendProps
->
setPropertyValue
(
"FillStyle"
,
uno
::
makeAny
(
drawing
::
FillStyle_NONE
));
// set auto-styles for Legend
// set auto-styles for Legend
const
SvXMLStylesContext
*
pStylesCtxt
=
mrImportHelper
.
GetAutoStylesContext
();
mrImportHelper
.
FillAutoStyle
(
sAutoStyleName
,
xLegendProps
);
if
(
pStylesCtxt
)
{
const
SvXMLStyleContext
*
pStyle
=
pStylesCtxt
->
FindStyleChildContext
(
SchXMLImportHelper
::
GetChartFamilyID
(),
sAutoStyleName
);
if
(
pStyle
&&
dynamic_cast
<
const
XMLPropStyleContext
*>
(
pStyle
)
!=
nullptr
)
const_cast
<
XMLPropStyleContext
*>
(
static_cast
<
const
XMLPropStyleContext
*>
(
pStyle
)
)
->
FillPropertySet
(
xLegendProps
);
}
}
}
SchXMLLegendContext
::~
SchXMLLegendContext
()
SchXMLLegendContext
::~
SchXMLLegendContext
()
...
...
xmloff/source/chart/SchXMLPlotAreaContext.cxx
Dosyayı görüntüle @
a07a6985
...
@@ -798,20 +798,9 @@ void SchXMLWallFloorContext::StartElement( const uno::Reference< xml::sax::XAttr
...
@@ -798,20 +798,9 @@ void SchXMLWallFloorContext::StartElement( const uno::Reference< xml::sax::XAttr
?
mxWallFloorSupplier
->
getWall
()
?
mxWallFloorSupplier
->
getWall
()
:
mxWallFloorSupplier
->
getFloor
(),
:
mxWallFloorSupplier
->
getFloor
(),
uno
::
UNO_QUERY
);
uno
::
UNO_QUERY
);
if
(
xProp
.
is
())
{
if
(
!
sAutoStyleName
.
isEmpty
())
{
const
SvXMLStylesContext
*
pStylesCtxt
=
mrImportHelper
.
GetAutoStylesContext
();
if
(
pStylesCtxt
)
{
SvXMLStyleContext
*
pStyle
=
const_cast
<
SvXMLStyleContext
*>
(
pStylesCtxt
->
FindStyleChildContext
(
SchXMLImportHelper
::
GetChartFamilyID
(),
sAutoStyleName
));
if
(
XMLPropStyleContext
*
pPropStyle
=
dynamic_cast
<
XMLPropStyleContext
*>
(
pStyle
))
if
(
!
sAutoStyleName
.
isEmpty
())
pPropStyle
->
FillPropertySet
(
xProp
);
mrImportHelper
.
FillAutoStyle
(
sAutoStyleName
,
xProp
);
}
}
}
}
}
}
}
...
@@ -870,17 +859,7 @@ void SchXMLStockContext::StartElement( const uno::Reference< xml::sax::XAttribut
...
@@ -870,17 +859,7 @@ void SchXMLStockContext::StartElement( const uno::Reference< xml::sax::XAttribut
break
;
break
;
}
}
if
(
xProp
.
is
())
mrImportHelper
.
FillAutoStyle
(
sAutoStyleName
,
xProp
);
{
const
SvXMLStylesContext
*
pStylesCtxt
=
mrImportHelper
.
GetAutoStylesContext
();
if
(
pStylesCtxt
)
{
SvXMLStyleContext
*
pStyle
=
const_cast
<
SvXMLStyleContext
*>
(
pStylesCtxt
->
FindStyleChildContext
(
SchXMLImportHelper
::
GetChartFamilyID
(),
sAutoStyleName
));
if
(
XMLPropStyleContext
*
pPropStyle
=
dynamic_cast
<
XMLPropStyleContext
*>
(
pStyle
))
pPropStyle
->
FillPropertySet
(
xProp
);
}
}
}
}
}
}
}
}
...
...
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