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
63c12112
Kaydet (Commit)
63c12112
authored
Haz 21, 2016
tarafından
Jan Holesovsky
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Simplify dynamic_cast followed by a static_cast.
Change-Id: I89fc21757493a42e17d518da585bafdb8f2e303a
üst
2abea8fd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
49 deletions
+36
-49
ximppage.cxx
xmloff/source/draw/ximppage.cxx
+36
-49
No files found.
xmloff/source/draw/ximppage.cxx
Dosyayı görüntüle @
63c12112
...
@@ -361,48 +361,42 @@ void SdXMLGenericPageContext::SetStyle( OUString& rStyleName )
...
@@ -361,48 +361,42 @@ void SdXMLGenericPageContext::SetStyle( OUString& rStyleName )
{
{
const
SvXMLImportContext
*
pContext
=
GetSdImport
().
GetShapeImport
()
->
GetAutoStylesContext
();
const
SvXMLImportContext
*
pContext
=
GetSdImport
().
GetShapeImport
()
->
GetAutoStylesContext
();
if
(
pContext
&&
dynamic_cast
<
const
SdXMLStylesContext
*>
(
pContext
)
!=
nullptr
)
if
(
const
SdXMLStylesContext
*
pStyles
=
dynamic_cast
<
const
SdXMLStylesContext
*>
(
pContext
)
)
{
{
const
SdXMLStylesContext
*
pStyles
=
static_cast
<
const
SdXMLStylesContext
*>
(
pContext
);
const
SvXMLStyleContext
*
pStyle
=
pStyles
->
FindStyleChildContext
(
if
(
pStyles
)
XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID
,
rStyleName
);
{
const
SvXMLStyleContext
*
pStyle
=
pStyles
->
FindStyleChildContext
(
XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID
,
rStyleName
);
if
(
pStyle
&&
dynamic_cast
<
const
XMLPropStyleContext
*>
(
pStyle
))
if
(
const
XMLPropStyleContext
*
pPropStyle
=
dynamic_cast
<
const
XMLPropStyleContext
*>
(
pStyle
))
{
Reference
<
beans
::
XPropertySet
>
xPropSet1
(
mxShapes
,
uno
::
UNO_QUERY
);
if
(
xPropSet1
.
is
())
{
{
const
XMLPropStyleContext
*
pPropStyle
=
static_cast
<
const
XMLPropStyleContext
*>
(
pStyle
);
Reference
<
beans
::
XPropertySet
>
xPropSet
(
xPropSet1
);
Reference
<
beans
::
XPropertySet
>
xBackgroundSet
;
Reference
<
beans
::
XPropertySet
>
xPropSet1
(
mxShapes
,
uno
::
UNO_QUERY
);
const
OUString
aBackground
(
"Background"
);
if
(
xPropSet1
.
is
()
)
if
(
xPropSet1
->
getPropertySetInfo
()
->
hasPropertyByName
(
aBackground
)
)
{
{
Reference
<
beans
::
XPropertySet
>
xPropSet
(
xPropSet1
);
Reference
<
beans
::
XPropertySetInfo
>
xInfo
(
xPropSet1
->
getPropertySetInfo
()
);
Reference
<
beans
::
XPropertySet
>
xBackgroundSet
;
if
(
xInfo
.
is
()
&&
xInfo
->
hasPropertyByName
(
aBackground
)
)
const
OUString
aBackground
(
"Background"
);
if
(
xPropSet1
->
getPropertySetInfo
()
->
hasPropertyByName
(
aBackground
)
)
{
{
Reference
<
beans
::
XPropertySetInfo
>
xInfo
(
xPropSet1
->
getPropertySetInfo
()
);
Reference
<
lang
::
XMultiServiceFactory
>
xServiceFact
(
GetSdImport
().
GetModel
(),
uno
::
UNO_QUERY
);
if
(
xInfo
.
is
()
&&
xInfo
->
hasPropertyByName
(
aBackground
)
)
if
(
xServiceFact
.
is
()
)
{
{
Reference
<
lang
::
XMultiServiceFactory
>
xServiceFact
(
GetSdImport
().
GetModel
(),
uno
::
UNO_QUERY
);
xBackgroundSet
.
set
(
xServiceFact
->
createInstance
(
"com.sun.star.drawing.Background"
),
UNO_QUERY
);
if
(
xServiceFact
.
is
())
{
xBackgroundSet
.
set
(
xServiceFact
->
createInstance
(
"com.sun.star.drawing.Background"
),
UNO_QUERY
);
}
}
}
if
(
xBackgroundSet
.
is
()
)
xPropSet
=
PropertySetMerger_CreateInstance
(
xPropSet1
,
xBackgroundSet
);
}
}
if
(
xPropSet
.
is
()
)
if
(
xBackgroundSet
.
is
()
)
{
xPropSet
=
PropertySetMerger_CreateInstance
(
xPropSet1
,
xBackgroundSet
);
const_cast
<
XMLPropStyleContext
*>
(
pPropStyle
)
->
FillPropertySet
(
xPropSet
);
}
if
(
xBackgroundSet
.
is
()
)
if
(
xPropSet
.
is
())
xPropSet1
->
setPropertyValue
(
aBackground
,
uno
::
makeAny
(
xBackgroundSet
)
);
{
}
const_cast
<
XMLPropStyleContext
*>
(
pPropStyle
)
->
FillPropertySet
(
xPropSet
);
if
(
xBackgroundSet
.
is
()
)
xPropSet1
->
setPropertyValue
(
aBackground
,
uno
::
makeAny
(
xBackgroundSet
)
);
}
}
}
}
}
}
...
@@ -424,21 +418,16 @@ void SdXMLGenericPageContext::SetLayout()
...
@@ -424,21 +418,16 @@ void SdXMLGenericPageContext::SetLayout()
const
SvXMLImportContext
*
pContext
=
GetSdImport
().
GetShapeImport
()
->
GetStylesContext
();
const
SvXMLImportContext
*
pContext
=
GetSdImport
().
GetShapeImport
()
->
GetStylesContext
();
if
(
pContext
&&
dynamic_cast
<
const
SdXMLStylesContext
*>
(
pContext
)
!=
nullptr
)
if
(
const
SdXMLStylesContext
*
pStyles
=
dynamic_cast
<
const
SdXMLStylesContext
*>
(
pContext
)
)
{
{
const
SdXMLStylesContext
*
pStyles
=
static_cast
<
const
SdXMLStylesContext
*>
(
pContext
);
const
SvXMLStyleContext
*
pStyle
=
pStyles
->
FindStyleChildContext
(
XML_STYLE_FAMILY_SD_PRESENTATIONPAGELAYOUT_ID
,
maPageLayoutName
);
if
(
pStyles
)
{
const
SvXMLStyleContext
*
pStyle
=
pStyles
->
FindStyleChildContext
(
XML_STYLE_FAMILY_SD_PRESENTATIONPAGELAYOUT_ID
,
maPageLayoutName
);
if
(
pStyle
&&
dynamic_cast
<
const
SdXMLPresentationPageLayoutContext
*>
(
pStyle
)
!=
nullptr
)
if
(
const
SdXMLPresentationPageLayoutContext
*
pLayout
=
dynamic_cast
<
const
SdXMLPresentationPageLayoutContext
*>
(
pStyle
))
{
{
const
SdXMLPresentationPageLayoutContext
*
pLayout
=
static_cast
<
const
SdXMLPresentationPageLayoutContext
*>
(
pStyle
);
nType
=
pLayout
->
GetTypeId
();
nType
=
pLayout
->
GetTypeId
();
}
}
}
}
}
if
(
-
1
==
nType
)
if
(
-
1
==
nType
)
{
{
Reference
<
container
::
XNameAccess
>
xPageLayouts
(
GetSdImport
().
getPageLayouts
()
);
Reference
<
container
::
XNameAccess
>
xPageLayouts
(
GetSdImport
().
getPageLayouts
()
);
...
@@ -484,7 +473,7 @@ void SdXMLGenericPageContext::DeleteAllShapes()
...
@@ -484,7 +473,7 @@ void SdXMLGenericPageContext::DeleteAllShapes()
void
SdXMLGenericPageContext
::
SetPageMaster
(
OUString
&
rsPageMasterName
)
void
SdXMLGenericPageContext
::
SetPageMaster
(
OUString
&
rsPageMasterName
)
{
{
if
(
GetSdImport
().
GetShapeImport
()
->
GetStylesContext
()
)
if
(
GetSdImport
().
GetShapeImport
()
->
GetStylesContext
()
)
{
{
// look for PageMaster with this name
// look for PageMaster with this name
...
@@ -493,19 +482,18 @@ void SdXMLGenericPageContext::SetPageMaster( OUString& rsPageMasterName )
...
@@ -493,19 +482,18 @@ void SdXMLGenericPageContext::SetPageMaster( OUString& rsPageMasterName )
const
SvXMLStyleContext
*
pStyle
=
pAutoStyles
?
pAutoStyles
->
FindStyleChildContext
(
XML_STYLE_FAMILY_SD_PAGEMASTERCONEXT_ID
,
rsPageMasterName
)
:
nullptr
;
const
SvXMLStyleContext
*
pStyle
=
pAutoStyles
?
pAutoStyles
->
FindStyleChildContext
(
XML_STYLE_FAMILY_SD_PAGEMASTERCONEXT_ID
,
rsPageMasterName
)
:
nullptr
;
if
(
pStyle
&&
dynamic_cast
<
const
SdXMLPageMasterContext
*>
(
pStyle
)
!=
nullptr
)
if
(
const
SdXMLPageMasterContext
*
pPageMaster
=
dynamic_cast
<
const
SdXMLPageMasterContext
*>
(
pStyle
)
)
{
{
const
SdXMLPageMasterContext
*
pPageMaster
=
static_cast
<
const
SdXMLPageMasterContext
*>
(
pStyle
);
const
SdXMLPageMasterStyleContext
*
pPageMasterContext
=
pPageMaster
->
GetPageMasterStyle
();
const
SdXMLPageMasterStyleContext
*
pPageMasterContext
=
pPageMaster
->
GetPageMasterStyle
();
if
(
pPageMasterContext
)
if
(
pPageMasterContext
)
{
{
Reference
<
drawing
::
XDrawPage
>
xMasterPage
(
GetLocalShapesContext
(),
uno
::
UNO_QUERY
);
Reference
<
drawing
::
XDrawPage
>
xMasterPage
(
GetLocalShapesContext
(),
uno
::
UNO_QUERY
);
if
(
xMasterPage
.
is
())
if
(
xMasterPage
.
is
())
{
{
// set sizes for this masterpage
// set sizes for this masterpage
Reference
<
beans
::
XPropertySet
>
xPropSet
(
xMasterPage
,
uno
::
UNO_QUERY
);
Reference
<
beans
::
XPropertySet
>
xPropSet
(
xMasterPage
,
uno
::
UNO_QUERY
);
if
(
xPropSet
.
is
())
if
(
xPropSet
.
is
())
{
{
xPropSet
->
setPropertyValue
(
"BorderBottom"
,
Any
(
pPageMasterContext
->
GetBorderBottom
()));
xPropSet
->
setPropertyValue
(
"BorderBottom"
,
Any
(
pPageMasterContext
->
GetBorderBottom
()));
xPropSet
->
setPropertyValue
(
"BorderLeft"
,
Any
(
pPageMasterContext
->
GetBorderLeft
()));
xPropSet
->
setPropertyValue
(
"BorderLeft"
,
Any
(
pPageMasterContext
->
GetBorderLeft
()));
...
@@ -518,7 +506,6 @@ void SdXMLGenericPageContext::SetPageMaster( OUString& rsPageMasterName )
...
@@ -518,7 +506,6 @@ void SdXMLGenericPageContext::SetPageMaster( OUString& rsPageMasterName )
}
}
}
}
}
}
}
}
}
}
...
...
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