summaryrefslogtreecommitdiff
path: root/xmloff/source/style/xmlaustp.cxx
diff options
context:
space:
mode:
authorChristian Lippka <cl@openoffice.org>2002-01-11 11:18:09 +0000
committerChristian Lippka <cl@openoffice.org>2002-01-11 11:18:09 +0000
commite220dde9855c5296c83b0dc85eea190122dcefea (patch)
tree6fafd0bdd59aa3a036afa920e541f5d6cf60f2ce /xmloff/source/style/xmlaustp.cxx
parent877d9bf1f95f438c800a6ac577e6fece64a3fe87 (diff)
#92487# add style:list-style for graphic shape styles
Diffstat (limited to 'xmloff/source/style/xmlaustp.cxx')
-rw-r--r--xmloff/source/style/xmlaustp.cxx88
1 files changed, 57 insertions, 31 deletions
diff --git a/xmloff/source/style/xmlaustp.cxx b/xmloff/source/style/xmlaustp.cxx
index 501d9581ae9e..a8b2dba7e400 100644
--- a/xmloff/source/style/xmlaustp.cxx
+++ b/xmloff/source/style/xmlaustp.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmlaustp.cxx,v $
*
- * $Revision: 1.14 $
+ * $Revision: 1.15 $
*
- * last change: $Author: dvo $ $Date: 2001-10-25 20:57:03 $
+ * last change: $Author: cl $ $Date: 2002-01-11 12:14:05 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -60,6 +60,10 @@
************************************************************************/
+#ifndef _COM_SUN_STAR_CONTAINER_XINDEXREPLACE_HPP_
+#include <com/sun/star/container/XIndexReplace.hpp>
+#endif
+
#ifndef _TOOLS_DEBUG_HXX
#include <tools/debug.hxx>
#endif
@@ -82,6 +86,10 @@
#include "xmlexp.hxx"
#endif
+#ifndef _XMLOFF_XMLTEXTLISTAUTOSTYLEPOOL_HXX
+#include "XMLTextListAutoStylePool.hxx"
+#endif
+
#ifndef _XMLOFF_PAGEMASTERSTYLEMAP_HXX
#include "PageMasterStyleMap.hxx"
#endif
@@ -112,14 +120,14 @@ void SvXMLAutoStylePoolP::exportStyleAttributes(
#endif
) const
{
- if (XML_STYLE_FAMILY_SD_GRAPHICS_ID == nFamily)
+ if( (XML_STYLE_FAMILY_SD_GRAPHICS_ID == nFamily) || (XML_STYLE_FAMILY_SD_PRESENTATION_ID == nFamily) )
{ // it's a graphics style
UniReference< XMLPropertySetMapper > aPropertyMapper = rPropExp.getPropertySetMapper();
DBG_ASSERT(aPropertyMapper.is(), "SvXMLAutoStylePoolP::exportStyleAttributes: invalid property set mapper!");
-#ifdef DBG_UTIL
sal_Bool bFoundControlShapeDataStyle = sal_False;
-#endif
+ sal_Bool bFoundNumberingRulesName = sal_False;
+
for ( vector< XMLPropertyState >::const_iterator pProp = rProperties.begin();
pProp != rProperties.end();
++pProp
@@ -127,36 +135,54 @@ void SvXMLAutoStylePoolP::exportStyleAttributes(
{
if (pProp->mnIndex > -1)
{ // it's a valid property
- if (CTF_SD_CONTROL_SHAPE_DATA_STYLE == aPropertyMapper->GetEntryContextId(pProp->mnIndex))
- { // it's the control shape data style property
+ switch( aPropertyMapper->GetEntryContextId(pProp->mnIndex) )
+ {
+ case CTF_SD_CONTROL_SHAPE_DATA_STYLE:
+ { // it's the control shape data style property
+
+ if (bFoundControlShapeDataStyle)
+ {
+ DBG_ERROR("SvXMLAutoStylePoolP::exportStyleAttributes: found two properties with the ControlShapeDataStyle context id!");
+ // already added the attribute for the first occurence
+ break;
+ }
+
+ // obtain the data style name
+ ::rtl::OUString sControlDataStyleName;
+ pProp->maValue >>= sControlDataStyleName;
+ DBG_ASSERT(sControlDataStyleName.getLength(), "SvXMLAutoStylePoolP::exportStyleAttributes: invalid property value for the data style name!");
+
+ // add the attribute
+ GetExport().AddAttribute(
+ aPropertyMapper->GetEntryNameSpace(pProp->mnIndex),
+ aPropertyMapper->GetEntryXMLName(pProp->mnIndex),
+ sControlDataStyleName );
-#ifdef DBG_UTIL
- if (bFoundControlShapeDataStyle)
+ // check if there is another property with the special context id we're handling here
+ bFoundControlShapeDataStyle = sal_True;
+ break;
+ }
+ case CTF_SD_NUMBERINGRULES_NAME:
{
- DBG_ERROR("SvXMLAutoStylePoolP::exportStyleAttributes: found two properties with the ControlShapeDataStyle context id!");
- // already added the attribute for the first occurence
+ if (bFoundNumberingRulesName)
+ {
+ DBG_ERROR("SvXMLAutoStylePoolP::exportStyleAttributes: found two properties with the numbering rules name context id!");
+ // already added the attribute for the first occurence
+ break;
+ }
+
+ uno::Reference< container::XIndexReplace > xNumRule;
+ pProp->maValue >>= xNumRule;
+ if( xNumRule.is() && (xNumRule->getCount() > 0 ) )
+ {
+ const OUString sName(((XMLTextListAutoStylePool*)&GetExport().GetTextParagraphExport()->GetListAutoStylePool())->Add( xNumRule ));
+
+ GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_LIST_STYLE_NAME, sName );
+ }
+
+ bFoundNumberingRulesName = sal_True;
break;
}
-#endif
- // obtain the data style name
- ::rtl::OUString sControlDataStyleName;
- pProp->maValue >>= sControlDataStyleName;
- DBG_ASSERT(sControlDataStyleName.getLength(), "SvXMLAutoStylePoolP::exportStyleAttributes: invalid property value for the data style name!");
-
- // add the attribute
- GetExport().AddAttribute(
- aPropertyMapper->GetEntryNameSpace(pProp->mnIndex),
- aPropertyMapper->GetEntryXMLName(pProp->mnIndex),
- sControlDataStyleName );
-
-#ifdef DBG_UTIL
- // in a non-pro version, check if there is another property with the special context id we're handling here
- bFoundControlShapeDataStyle = sal_True;
- continue;
-#else
- // in a pro version, just leave the loop
- break;
-#endif
}
}
}