summaryrefslogtreecommitdiff
path: root/sc/source/filter/xml
diff options
context:
space:
mode:
authorSascha Ballach <sab@openoffice.org>2000-12-13 16:11:44 +0000
committerSascha Ballach <sab@openoffice.org>2000-12-13 16:11:44 +0000
commit20a6af13d9d9f4f7c1a5e1a2165c0c8493ea28a5 (patch)
tree883f77d00275bf93e610d5611c9cb3b4a3dbee25 /sc/source/filter/xml
parentced875b715acab9c03d10ed875dd945fb3b8cb10 (diff)
set only the row properties if thea are different to the defaults
Diffstat (limited to 'sc/source/filter/xml')
-rw-r--r--sc/source/filter/xml/xmlrowi.cxx40
-rw-r--r--sc/source/filter/xml/xmlstyle.cxx10
-rw-r--r--sc/source/filter/xml/xmlstyle.hxx5
-rw-r--r--sc/source/filter/xml/xmlstyli.cxx11
4 files changed, 39 insertions, 27 deletions
diff --git a/sc/source/filter/xml/xmlrowi.cxx b/sc/source/filter/xml/xmlrowi.cxx
index d6d1d32367ff..43a3f875ca02 100644
--- a/sc/source/filter/xml/xmlrowi.cxx
+++ b/sc/source/filter/xml/xmlrowi.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmlrowi.cxx,v $
*
- * $Revision: 1.8 $
+ * $Revision: 1.9 $
*
- * last change: $Author: sab $ $Date: 2000-12-08 14:09:26 $
+ * last change: $Author: sab $ $Date: 2000-12-13 17:09:27 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -207,6 +207,9 @@ void ScXMLTableRowContext::EndElement()
uno::Reference<table::XTableRows> xTableRows = xColumnRowRange->getRows();
if (xTableRows.is())
{
+ XMLTableStylesContext *pStyles = (XMLTableStylesContext *)&rXMLImport.GetAutoStyles();
+ XMLTableStyleContext* pStyle = (XMLTableStyleContext *)pStyles->FindStyleChildContext(
+ XML_STYLE_FAMILY_TABLE_ROW, sStyleName, sal_True);
for (sal_Int32 i = nCurrentRow - nRepeatedRows + 1; i <= nCurrentRow; i++)
{
uno::Any aRow;
@@ -220,35 +223,34 @@ void ScXMLTableRowContext::EndElement()
uno::Reference <beans::XPropertySet> xRowProperties(xTableRow, uno::UNO_QUERY);
if (xRowProperties.is())
{
- XMLTableStylesContext *pStyles = (XMLTableStylesContext *)&rXMLImport.GetAutoStyles();
- XMLTableStyleContext* pStyle = (XMLTableStyleContext *)pStyles->FindStyleChildContext(
- XML_STYLE_FAMILY_TABLE_ROW, sStyleName, sal_True);
if (pStyle)
{
pStyle->FillPropertySet(xRowProperties);
}
- uno::Any aVisibleAny = xRowProperties->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_ISVISIBLE)));
- uno::Any aFilteredAny = xRowProperties->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_ISFILTERED)));
+ uno::Any aVisibleAny;// = xRowProperties->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_ISVISIBLE)));
+ uno::Any aFilteredAny;// = xRowProperties->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_ISFILTERED)));
+ sal_Bool bVisible (sal_True);
+ sal_Bool bFiltered (sal_False);
if (sVisibility.compareToAscii(sXML_collapse) == 0)
{
- sal_Bool bValue = sal_False;
- aVisibleAny <<= bValue;
- aFilteredAny <<= bValue;
+ bVisible = sal_False;
+ aVisibleAny <<= bVisible;
+ aFilteredAny <<= bFiltered;
}
else if (sVisibility.compareToAscii(sXML_filter) == 0)
{
- sal_Bool bValue = sal_False;
- aVisibleAny <<= bValue;
- bValue = sal_True;
- aFilteredAny <<= bValue;
+ bVisible = sal_False;
+ aVisibleAny <<= bVisible;
+ bFiltered = sal_True;
+ aFilteredAny <<= bFiltered;
}
- else
+ /*else
{
sal_Bool bValue = sal_True;
aVisibleAny <<= bValue;
bValue = sal_False;
aFilteredAny <<= bValue;
- }
+ }*/
/*uno::Any aAny = xRowProperties->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_OPTIMALHEIGHT)));
if (sOptimalHeight.compareToAscii(sXML_true) != 0)
{
@@ -260,8 +262,10 @@ void ScXMLTableRowContext::EndElement()
sal_Bool bValue = sal_True;
aAny <<= bValue;
}*/
- xRowProperties->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_ISVISIBLE)), aVisibleAny);
- xRowProperties->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_ISFILTERED)), aFilteredAny);
+ if (!bVisible)
+ xRowProperties->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_ISVISIBLE)), aVisibleAny);
+ if (bFiltered)
+ xRowProperties->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_ISFILTERED)), aFilteredAny);
}
}
}
diff --git a/sc/source/filter/xml/xmlstyle.cxx b/sc/source/filter/xml/xmlstyle.cxx
index 7c73298b62f0..e7f3dbc5d46a 100644
--- a/sc/source/filter/xml/xmlstyle.cxx
+++ b/sc/source/filter/xml/xmlstyle.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmlstyle.cxx,v $
*
- * $Revision: 1.19 $
+ * $Revision: 1.20 $
*
- * last change: $Author: sab $ $Date: 2000-11-28 16:18:57 $
+ * last change: $Author: sab $ $Date: 2000-12-13 17:11:43 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -209,7 +209,7 @@ const XMLPropertyMapEntry aXMLScRowStylesProperties[] =
{ "OptimalHeight", XML_NAMESPACE_STYLE, sXML_use_optimal_row_height, XML_TYPE_BOOL, CTF_SC_ROWOPTIMALHEIGHT}, // This Position in the Map should not be changed
// This Position in the Map should not be changed
{ "Height", XML_NAMESPACE_STYLE, sXML_row_height, XML_TYPE_MEASURE, CTF_SC_ROWHEIGHT},
- { "IsManualPageBreak", XML_NAMESPACE_FO, sXML_break_before, XML_SC_TYPE_BREAKBEFORE, 0},
+ { "IsManualPageBreak", XML_NAMESPACE_FO, sXML_break_before, XML_SC_TYPE_BREAKBEFORE, CTF_SC_ROWBREAKBEFORE},
{ 0L }
};
@@ -1537,13 +1537,13 @@ sal_Bool XmlScPropHdl_BreakBefore::importXML(
if (rStrImpValue.compareToAscii(sXML_auto) == 0)
{
bValue = sal_False;
- rValue <<= bValue;
+ rValue = ::cppu::bool2any(bValue);
bRetval = sal_True;
}
else if (rStrImpValue.compareToAscii(sXML_page) == 0)
{
bValue = sal_True;
- rValue <<= bValue;
+ rValue = ::cppu::bool2any(bValue);
bRetval = sal_True;
}
diff --git a/sc/source/filter/xml/xmlstyle.hxx b/sc/source/filter/xml/xmlstyle.hxx
index 9f056e068218..da9a7b06f257 100644
--- a/sc/source/filter/xml/xmlstyle.hxx
+++ b/sc/source/filter/xml/xmlstyle.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmlstyle.hxx,v $
*
- * $Revision: 1.14 $
+ * $Revision: 1.15 $
*
- * last change: $Author: sab $ $Date: 2000-11-28 16:18:57 $
+ * last change: $Author: sab $ $Date: 2000-12-13 17:11:44 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -134,6 +134,7 @@ extern const XMLPropertyMapEntry aXMLScTableStylesProperties[];
#define CTF_SC_ROWHEIGHT 50
#define CTF_SC_ROWOPTIMALHEIGHT 51
+#define CTF_SC_ROWBREAKBEFORE 52
//ColumnStyles
#define XML_SC_TYPE_BREAKBEFORE (XML_SC_TYPES_START + 50)
diff --git a/sc/source/filter/xml/xmlstyli.cxx b/sc/source/filter/xml/xmlstyli.cxx
index a7bf74dd809a..55fea7d98546 100644
--- a/sc/source/filter/xml/xmlstyli.cxx
+++ b/sc/source/filter/xml/xmlstyli.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmlstyli.cxx,v $
*
- * $Revision: 1.21 $
+ * $Revision: 1.22 $
*
- * last change: $Author: sab $ $Date: 2000-12-08 14:40:18 $
+ * last change: $Author: sab $ $Date: 2000-12-13 17:11:44 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -235,6 +235,7 @@ void ScXMLRowImportPropertyMapper::finished(::std::vector< XMLPropertyState >& r
SvXMLImportPropertyMapper::finished(rProperties, nStartIndex, nEndIndex);
XMLPropertyState* pHeight = NULL;
XMLPropertyState* pOptimalHeight = NULL;
+ XMLPropertyState* pPageBreak = NULL;
::std::vector< XMLPropertyState >::iterator property = rProperties.begin();
for (property; property != rProperties.end(); property++)
{
@@ -243,6 +244,7 @@ void ScXMLRowImportPropertyMapper::finished(::std::vector< XMLPropertyState >& r
{
case CTF_SC_ROWHEIGHT : pHeight = property; break;
case CTF_SC_ROWOPTIMALHEIGHT : pOptimalHeight = property; break;
+ case CTF_SC_ROWBREAKBEFORE : pPageBreak = property; break;
}
}
if (pOptimalHeight)
@@ -261,6 +263,11 @@ void ScXMLRowImportPropertyMapper::finished(::std::vector< XMLPropertyState >& r
rProperties.push_back(*pOptimalHeight);
delete pOptimalHeight;
}
+ if (pPageBreak)
+ {
+ if(!(::cppu::any2bool(pPageBreak->maValue)))
+ pPageBreak->mnIndex = -1;
+ }
}
class ScXMLMapContext : public SvXMLImportContext