summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorDaniel Vogelheim <dvo@openoffice.org>2001-03-23 15:30:17 +0000
committerDaniel Vogelheim <dvo@openoffice.org>2001-03-23 15:30:17 +0000
commit6608709f94717d276255e25805eed64c6217ac87 (patch)
tree1c735383181a8b54e6fe4fa66955e46a2fdb1981 /xmloff
parent8fb37b3862dbdb4652d31258fd2b8558a3a8d295 (diff)
#84808# fixed: hidden text, hidden paragraph, conditional field now display
correctly on load (attributes added) fixed: update forced for certain fields on loading in organizer mode/styles only mode
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/dtd/text.mod7
-rw-r--r--xmloff/inc/txtflde.hxx8
-rw-r--r--xmloff/inc/txtfldi.hxx19
-rw-r--r--xmloff/inc/xmlkywd.hxx6
-rw-r--r--xmloff/source/text/txtflde.cxx19
-rw-r--r--xmloff/source/text/txtfldi.cxx232
6 files changed, 225 insertions, 66 deletions
diff --git a/xmloff/dtd/text.mod b/xmloff/dtd/text.mod
index a28b2c2671db..3ab0765b5d4d 100644
--- a/xmloff/dtd/text.mod
+++ b/xmloff/dtd/text.mod
@@ -1,5 +1,5 @@
<!--
- $Id: text.mod,v 1.25 2001-02-26 14:53:39 cl Exp $
+ $Id: text.mod,v 1.26 2001-03-23 16:30:15 dvo Exp $
The Contents of this file are made available subject to the terms of
either of the following licenses
@@ -514,13 +514,16 @@
<!ATTLIST text:conditional-text text:condition %formula; #REQUIRED>
<!ATTLIST text:conditional-text text:string-value-if-false %string; #REQUIRED>
<!ATTLIST text:conditional-text text:string-value-if-true %string; #REQUIRED>
+<!ATTLIST text:conditional-text text:current-value %boolean; "false">
<!ELEMENT text:hidden-text (#PCDATA)>
<!ATTLIST text:hidden-text text:condition %formula; #REQUIRED>
<!ATTLIST text:hidden-text text:string-value %string; #REQUIRED>
+<!ATTLIST text:hidden-text text:is-hidden %boolean; "false">
<!ELEMENT text:hidden-paragraph EMPTY>
<!ATTLIST text:hidden-paragraph text:condition %formula; #REQUIRED>
+<!ATTLIST text:hidden-paragraph text:is-hidden %boolean; "false">
<!ELEMENT text:chapter (#PCDATA)>
<!ATTLIST text:chapter text:display (name|number|number-and-name|
@@ -730,6 +733,8 @@
<!ATTLIST text:section text:protected %boolean; "false">
<!ATTLIST text:section text:display (true|none|condition) "true">
<!ATTLIST text:section text:condition %formula; #IMPLIED>
+<!ATTLIST text:section text:protect %boolean; "false">
+<!ATTLIST text:section text:protection-key CDATA #IMPLIED>
<!ELEMENT text:section-source EMPTY>
<!ATTLIST text:section-source xlink:href %string; #IMPLIED>
diff --git a/xmloff/inc/txtflde.hxx b/xmloff/inc/txtflde.hxx
index dfbfaba8d483..1bb9ebd6b930 100644
--- a/xmloff/inc/txtflde.hxx
+++ b/xmloff/inc/txtflde.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: txtflde.hxx,v $
*
- * $Revision: 1.15 $
+ * $Revision: 1.16 $
*
- * last change: $Author: dvo $ $Date: 2001-03-09 14:10:57 $
+ * last change: $Author: dvo $ $Date: 2001-03-23 16:30:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -442,7 +442,7 @@ private:
// property names
const ::rtl::OUString sPropertyContent;
const ::rtl::OUString sPropertyIsFixed;
- const ::rtl::OUString sPropertyAuthorFullname;
+ const ::rtl::OUString sPropertyFullName;
const ::rtl::OUString sPropertyFieldSubType;
const ::rtl::OUString sPropertyHint;
const ::rtl::OUString sPropertyPlaceholder;
@@ -500,6 +500,8 @@ private:
const ::rtl::OUString sPropertyDate;
const ::rtl::OUString sPropertyMeasureKind;
const ::rtl::OUString sPropertyInstanceName;
+ const ::rtl::OUString sPropertyIsHidden;
+ const ::rtl::OUString sPropertyIsConditionTrue;
const ::rtl::OUString sEmpty;
diff --git a/xmloff/inc/txtfldi.hxx b/xmloff/inc/txtfldi.hxx
index 574274a10141..dc9c0b92435d 100644
--- a/xmloff/inc/txtfldi.hxx
+++ b/xmloff/inc/txtfldi.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: txtfldi.hxx,v $
*
- * $Revision: 1.13 $
+ * $Revision: 1.14 $
*
- * last change: $Author: cl $ $Date: 2001-02-01 19:10:54 $
+ * last change: $Author: dvo $ $Date: 2001-03-23 16:30:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -159,6 +159,8 @@ enum XMLTextFieldAttrTokens
XML_TOK_TEXTFIELD_STRING_VALUE_IF_TRUE,
XML_TOK_TEXTFIELD_STRING_VALUE_IF_FALSE,
XML_TOK_TEXTFIELD_REVISION,
+ XML_TOK_TEXTFIELD_IS_HIDDEN,
+ XML_TOK_TEXTFIELD_CURRENT_VALUE,
XML_TOK_TEXTFIELD_REFERENCE_FORMAT,
XML_TOK_TEXTFIELD_REF_NAME,
@@ -185,6 +187,7 @@ enum XMLTextFieldAttrTokens
class XMLTextFieldImportContext : public SvXMLImportContext
{
const ::rtl::OUString sServicePrefix;
+ const ::rtl::OUString sIsFixed;
// data members
::rtl::OUStringBuffer sContentBuffer; /// collect character data
@@ -254,6 +257,12 @@ protected:
sal_Bool CreateField(::com::sun::star::uno::Reference<
::com::sun::star::beans::XPropertySet> & xField,
const ::rtl::OUString& sServiceName);
+
+ /// force an update of the field's value
+ /// call update on optional XUptadeable interface; (disable Fixed property)
+ void ForceUpdate(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertySet> & rPropertySet);
};
@@ -783,8 +792,10 @@ protected:
class XMLHiddenParagraphImportContext : public XMLTextFieldImportContext
{
const ::rtl::OUString sPropertyCondition;
+ const ::rtl::OUString sPropertyIsHidden;
::rtl::OUString sCondition;
+ sal_Bool bIsHidden;
public:
@@ -815,6 +826,7 @@ class XMLConditionalTextImportContext : public XMLTextFieldImportContext
const ::rtl::OUString sPropertyCondition;
const ::rtl::OUString sPropertyTrueContent;
const ::rtl::OUString sPropertyFalseContent;
+ const ::rtl::OUString sPropertyIsConditionTrue;
::rtl::OUString sCondition;
::rtl::OUString sTrueContent;
@@ -823,6 +835,7 @@ class XMLConditionalTextImportContext : public XMLTextFieldImportContext
sal_Bool bConditionOK;
sal_Bool bTrueOK;
sal_Bool bFalseOK;
+ sal_Bool bCurrentValue;
public:
@@ -852,12 +865,14 @@ class XMLHiddenTextImportContext : public XMLTextFieldImportContext
{
const ::rtl::OUString sPropertyCondition;
const ::rtl::OUString sPropertyContent;
+ const ::rtl::OUString sPropertyIsHidden;
::rtl::OUString sCondition;
::rtl::OUString sString;
sal_Bool bConditionOK;
sal_Bool bStringOK;
+ sal_Bool bIsHidden;
public:
diff --git a/xmloff/inc/xmlkywd.hxx b/xmloff/inc/xmlkywd.hxx
index 46cba4b9331d..b208f9b9aa55 100644
--- a/xmloff/inc/xmlkywd.hxx
+++ b/xmloff/inc/xmlkywd.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: xmlkywd.hxx,v $
*
- * $Revision: 1.134 $
+ * $Revision: 1.135 $
*
- * last change: $Author: mtg $ $Date: 2001-03-23 13:37:23 $
+ * last change: $Author: dvo $ $Date: 2001-03-23 16:30:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -475,6 +475,7 @@ XML_CONSTASCII_ACTION( sXML_currency, "currency");
XML_CONSTASCII_ACTION( sXML_currency_style, "currency-style" );
XML_CONSTASCII_ACTION( sXML_currency_symbol, "currency-symbol" );
XML_CONSTASCII_ACTION( sXML_current, "current" );
+XML_CONSTASCII_ACTION( sXML_current_value, "current-value" );
XML_CONSTASCII_ACTION( sXML_cursor_position, "cursor-position" );
XML_CONSTASCII_ACTION( sXML_cursor_position_x, "cursor-position-x" );
XML_CONSTASCII_ACTION( sXML_cursor_position_y, "cursor-position-y" );
@@ -917,6 +918,7 @@ XML_CONSTASCII_ACTION( sXML_into_english_number, "into-english-number" );
XML_CONSTASCII_ACTION( sXML_inverse, "inverse" );
XML_CONSTASCII_ACTION( sXML_is_active, "is-active");
XML_CONSTASCII_ACTION( sXML_is_data_layout_field, "is-data-layout-field");
+XML_CONSTASCII_ACTION( sXML_is_hidden, "is-hidden" );
XML_CONSTASCII_ACTION( sXML_is_selection, "is-selection");
XML_CONSTASCII_ACTION( sXML_isbn, "isbn" );
XML_CONSTASCII_ACTION( sXML_italic, "italic" );
diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx
index f4d0836b6fca..532250a67685 100644
--- a/xmloff/source/text/txtflde.cxx
+++ b/xmloff/source/text/txtflde.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: txtflde.cxx,v $
*
- * $Revision: 1.26 $
+ * $Revision: 1.27 $
*
- * last change: $Author: dvo $ $Date: 2001-03-22 13:06:55 $
+ * last change: $Author: dvo $ $Date: 2001-03-23 16:30:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -392,7 +392,7 @@ XMLTextFieldExport::XMLTextFieldExport( SvXMLExport& rExp,
RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.FieldMaster.")),
sPropertyContent(RTL_CONSTASCII_USTRINGPARAM("Content")),
sPropertyIsFixed(RTL_CONSTASCII_USTRINGPARAM("IsFixed")),
- sPropertyAuthorFullname(RTL_CONSTASCII_USTRINGPARAM("FullName")),
+ sPropertyFullName(RTL_CONSTASCII_USTRINGPARAM("FullName")),
sPropertyFieldSubType(RTL_CONSTASCII_USTRINGPARAM("UserDataType")),
sPropertyHint(RTL_CONSTASCII_USTRINGPARAM("Hint")),
sPropertyPlaceholder(RTL_CONSTASCII_USTRINGPARAM("PlaceHolder")),
@@ -459,6 +459,8 @@ XMLTextFieldExport::XMLTextFieldExport( SvXMLExport& rExp,
sPropertyDate(RTL_CONSTASCII_USTRINGPARAM("Date")),
sPropertyMeasureKind(RTL_CONSTASCII_USTRINGPARAM("Kind")),
sPropertyInstanceName(RTL_CONSTASCII_USTRINGPARAM("InstanceName")),
+ sPropertyIsHidden(RTL_CONSTASCII_USTRINGPARAM("IsHidden")),
+ sPropertyIsConditionTrue(RTL_CONSTASCII_USTRINGPARAM("IsConditionTrue")),
pCombinedCharactersPropertyState(pCombinedCharState)
{
SetExportOnlyUsedFieldDeclarations();
@@ -1466,6 +1468,9 @@ void XMLTextFieldExport::ExportFieldHelper(
GetStringProperty(sPropertyTrueContent, rPropSet));
ProcessString(sXML_string_value_if_false,
GetStringProperty(sPropertyFalseContent, rPropSet));
+ ProcessBoolean(sXML_current_value,
+ GetBoolProperty(sPropertyIsConditionTrue, rPropSet),
+ sal_False);
ExportElement(sXML_conditional_text, sPresentation);
break;
@@ -1474,12 +1479,18 @@ void XMLTextFieldExport::ExportFieldHelper(
GetStringProperty(sPropertyCondition, rPropSet));
ProcessString(sXML_string_value,
GetStringProperty(sPropertyContent, rPropSet));
+ ProcessBoolean(sXML_is_hidden,
+ GetBoolProperty(sPropertyIsHidden, rPropSet),
+ sal_False);
ExportElement(sXML_hidden_text, sPresentation);
break;
case FIELD_ID_HIDDEN_PARAGRAPH:
ProcessString(sXML_condition,
GetStringProperty(sPropertyCondition, rPropSet));
+ ProcessBoolean(sXML_is_hidden,
+ GetBoolProperty(sPropertyIsHidden, rPropSet),
+ sal_False);
DBG_ASSERT(sPresentation.equals(sEmpty),
"Unexpected presentation for hidden paragraph field");
ExportElement(sXML_hidden_paragraph);
@@ -2589,7 +2600,7 @@ const sal_Char* XMLTextFieldExport::MapAuthorFieldName(
const Reference<XPropertySet> & xPropSet)
{
// Initalen oder voller Name?
- return GetBoolProperty(sPropertyAuthorFullname, xPropSet)
+ return GetBoolProperty(sPropertyFullName, xPropSet)
? sXML_author_name : sXML_author_initials;
}
diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx
index 9df86538f2c3..b79a795a83c4 100644
--- a/xmloff/source/text/txtfldi.cxx
+++ b/xmloff/source/text/txtfldi.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: txtfldi.cxx,v $
*
- * $Revision: 1.22 $
+ * $Revision: 1.23 $
*
- * last change: $Author: mib $ $Date: 2001-03-19 09:41:43 $
+ * last change: $Author: dvo $ $Date: 2001-03-23 16:30:17 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -197,6 +197,10 @@
#include <com/sun/star/text/BibliographyDataField.hpp>
#endif
+#ifndef _COM_SUN_STAR_UTIL_XUPDATABLE_HPP_
+#include <com/sun/star/util/XUpdatable.hpp>
+#endif
+
#ifndef _RTL_USTRING
#include <rtl/ustring>
#endif
@@ -337,6 +341,8 @@ const sal_Char sAPI_representation[] = "Representation";
const sal_Char sAPI_date[] = "Date";
const sal_Char sAPI_url_content[] = "URLContent";
const sal_Char sAPI_script_type[] = "ScriptType";
+const sal_Char sAPI_is_hidden[] = "IsHidden";
+const sal_Char sAPI_is_condition_true[] = "IsConditionTrue";
const sal_Char sAPI_true[] = "TRUE";
@@ -398,6 +404,9 @@ static __FAR_DATA SvXMLTokenMapEntry aTextFieldAttrTokenMap[] =
{ XML_NAMESPACE_TEXT, sXML_annotation, XML_TOK_TEXTFIELD_ANNOTATION },
{ XML_NAMESPACE_SCRIPT, sXML_language, XML_TOK_TEXTFIELD_LANGUAGE },
{ XML_NAMESPACE_TEXT, sXML_kind, XML_TOK_TEXTFIELD_MEASURE_KIND },
+ { XML_NAMESPACE_TEXT, sXML_is_hidden, XML_TOK_TEXTFIELD_IS_HIDDEN },
+ { XML_NAMESPACE_TEXT, sXML_current_value,
+ XML_TOK_TEXTFIELD_CURRENT_VALUE },
XML_TOKEN_MAP_END
};
@@ -422,6 +431,7 @@ XMLTextFieldImportContext::XMLTextFieldImportContext(
sContentBuffer(),
rTextImportHelper(rHlp),
bValid(sal_False),
+ sIsFixed(RTL_CONSTASCII_USTRINGPARAM(sAPI_is_fixed)),
sServicePrefix(RTL_CONSTASCII_USTRINGPARAM(
sAPI_textfield_prefix))
{
@@ -796,6 +806,22 @@ XMLTextFieldImportContext::CreateTextFieldImportContext(
}
+void XMLTextFieldImportContext::ForceUpdate(
+ const Reference<XPropertySet> & rPropertySet)
+{
+ // force update
+ Reference<XUpdatable> xUpdate(rPropertySet, UNO_QUERY);
+ if (xUpdate.is())
+ {
+ xUpdate->update();
+ }
+ else
+ {
+ DBG_ERROR("Expected XUpdatable support!");
+ }
+}
+
+
//
// XMLSenderFieldImportContext
@@ -896,20 +922,31 @@ void XMLSenderFieldImportContext::ProcessAttribute(
}
void XMLSenderFieldImportContext::PrepareField(
- const Reference<XPropertySet> & xPropSet)
+ const Reference<XPropertySet> & rPropSet)
{
// set members
Any aAny;
aAny <<= nSubType;
- xPropSet->setPropertyValue(sPropertyFieldSubType, aAny);
+ rPropSet->setPropertyValue(sPropertyFieldSubType, aAny);
+ // set fixed
aAny.setValue( &bFixed, ::getBooleanCppuType() );
- xPropSet->setPropertyValue(sPropertyFixed, aAny);
+ rPropSet->setPropertyValue(sPropertyFixed, aAny);
+ // set content if fixed
if (bFixed)
{
- aAny <<= GetContent();
- xPropSet->setPropertyValue(sPropertyContent, aAny);
+ // in organizer or styles-only mode: force update
+ if (GetImport().GetTextImport()->IsOrganizerMode() ||
+ GetImport().GetTextImport()->IsStylesOnlyMode() )
+ {
+ ForceUpdate(rPropSet);
+ }
+ else
+ {
+ aAny <<= GetContent();
+ rPropSet->setPropertyValue(sPropertyContent, aAny);
+ }
}
}
@@ -947,20 +984,30 @@ void XMLAuthorFieldImportContext::StartElement(
}
void XMLAuthorFieldImportContext::PrepareField(
- const Reference<XPropertySet> & xPropSet)
+ const Reference<XPropertySet> & rPropSet)
{
// set members
Any aAny;
aAny.setValue( &bAuthorFullName, ::getBooleanCppuType() );
- xPropSet->setPropertyValue(sPropertyAuthorFullName, aAny);
+ rPropSet->setPropertyValue(sPropertyAuthorFullName, aAny);
aAny.setValue( &bFixed, ::getBooleanCppuType() );
- xPropSet->setPropertyValue(sPropertyFixed, aAny);
+ rPropSet->setPropertyValue(sPropertyFixed, aAny);
+ // set content if fixed
if (bFixed)
{
- aAny <<= GetContent();
- xPropSet->setPropertyValue(sPropertyContent, aAny);
+ // organizer or styles-only mode: force update
+ if (GetImport().GetTextImport()->IsOrganizerMode() ||
+ GetImport().GetTextImport()->IsStylesOnlyMode() )
+ {
+ ForceUpdate(rPropSet);
+ }
+ else
+ {
+ aAny <<= GetContent();
+ rPropSet->setPropertyValue(sPropertyContent, aAny);
+ }
}
}
@@ -1313,48 +1360,62 @@ void XMLTimeFieldImportContext::ProcessAttribute(
}
void XMLTimeFieldImportContext::PrepareField(
- const Reference<XPropertySet> & xPropertySet)
+ const Reference<XPropertySet> & rPropertySet)
{
Any aAny;
// all properties are optional (except IsDate)
Reference<XPropertySetInfo> xPropertySetInfo(
- xPropertySet->getPropertySetInfo());
+ rPropertySet->getPropertySetInfo());
if (xPropertySetInfo->hasPropertyByName(sPropertyFixed))
{
aAny.setValue( &bFixed, ::getBooleanCppuType() );
- xPropertySet->setPropertyValue(sPropertyFixed, aAny);
+ rPropertySet->setPropertyValue(sPropertyFixed, aAny);
}
aAny.setValue( &bIsDate, ::getBooleanCppuType() );
- xPropertySet->setPropertyValue(sPropertyIsDate, aAny);
+ rPropertySet->setPropertyValue(sPropertyIsDate, aAny);
if (xPropertySetInfo->hasPropertyByName(sPropertyAdjust))
{
aAny <<= nAdjust;
- xPropertySet->setPropertyValue(sPropertyAdjust, aAny);
- }
-
- if (bFixed && bTimeOK &&
- xPropertySetInfo->hasPropertyByName(sPropertyDateTimeValue))
- {
- aAny <<= aDateTimeValue;
- xPropertySet->setPropertyValue(sPropertyDateTimeValue, aAny);
+ rPropertySet->setPropertyValue(sPropertyAdjust, aAny);
}
- if (bFixed && bTimeOK &&
- xPropertySetInfo->hasPropertyByName(sPropertyDateTime))
+ // set value
+ if (bFixed)
{
- aAny <<= aDateTimeValue;
- xPropertySet->setPropertyValue(sPropertyDateTime, aAny);
+ // organizer or styles-only mode: force update
+ if (GetImport().GetTextImport()->IsOrganizerMode() ||
+ GetImport().GetTextImport()->IsStylesOnlyMode() )
+ {
+ ForceUpdate(rPropertySet);
+ }
+ else
+ {
+ // normal mode: set value (if present)
+ if (bTimeOK)
+ {
+ if (xPropertySetInfo->hasPropertyByName(sPropertyDateTimeValue))
+ {
+ aAny <<= aDateTimeValue;
+ rPropertySet->setPropertyValue(sPropertyDateTimeValue,aAny);
+ }
+ else if (xPropertySetInfo->hasPropertyByName(sPropertyDateTime))
+ {
+ aAny <<= aDateTimeValue;
+ rPropertySet->setPropertyValue(sPropertyDateTime, aAny);
+ }
+ }
+ }
}
if (bFormatOK &&
xPropertySetInfo->hasPropertyByName(sPropertyNumberFormat))
{
aAny <<= nFormatKey;
- xPropertySet->setPropertyValue(sPropertyNumberFormat, aAny);
+ rPropertySet->setPropertyValue(sPropertyNumberFormat, aAny);
}
}
@@ -1722,26 +1783,40 @@ void XMLSimpleDocInfoImportContext::ProcessAttribute(
}
void XMLSimpleDocInfoImportContext::PrepareField(
- const Reference<XPropertySet> & xPropertySet)
+ const Reference<XPropertySet> & rPropertySet)
{
Any aAny;
aAny.setValue(&bFixed, ::getBooleanCppuType() );
- xPropertySet->setPropertyValue(sPropertyFixed, aAny);
+ rPropertySet->setPropertyValue(sPropertyFixed, aAny);
- // set Content (if not fixed) AND CurrentPresentation
- aAny <<= GetContent();
-
- if (bFixed && bHasAuthor)
+ // set Content and CurrentPresentation (if fixed)
+ if (bFixed)
{
- xPropertySet->setPropertyValue(sPropertyAuthor, aAny);
- }
+ // in organizer-mode or styles-only-mode, only force update
+ if (GetImport().GetTextImport()->IsOrganizerMode() ||
+ GetImport().GetTextImport()->IsStylesOnlyMode() )
+ {
+ ForceUpdate(rPropertySet);
+ }
+ else
+ {
+ // set content (author, if that's the name) and current
+ // presentation
+ aAny <<= GetContent();
- if (bFixed && bHasContent)
- {
- xPropertySet->setPropertyValue(sPropertyContent, aAny);
- }
+ if (bFixed && bHasAuthor)
+ {
+ rPropertySet->setPropertyValue(sPropertyAuthor, aAny);
+ }
- xPropertySet->setPropertyValue(sPropertyCurrentPresentation, aAny);
+ if (bFixed && bHasContent)
+ {
+ rPropertySet->setPropertyValue(sPropertyContent, aAny);
+ }
+
+ rPropertySet->setPropertyValue(sPropertyCurrentPresentation, aAny);
+ }
+ }
}
const sal_Char* XMLSimpleDocInfoImportContext::MapTokenToServiceName(
@@ -1840,20 +1915,28 @@ XMLRevisionDocInfoImportContext::XMLRevisionDocInfoImportContext(
}
void XMLRevisionDocInfoImportContext::PrepareField(
- const Reference<XPropertySet> & xPropertySet)
+ const Reference<XPropertySet> & rPropertySet)
{
- XMLSimpleDocInfoImportContext::PrepareField(xPropertySet);
+ XMLSimpleDocInfoImportContext::PrepareField(rPropertySet);
- // set revision number if fixed
+ // set revision number
+ // if fixed, if not in organizer-mode, if not in styles-only-mode
if (bFixed)
{
- sal_Int32 nTmp;
-
- if (SvXMLUnitConverter::convertNumber(nTmp, GetContent()))
+ if ( GetImport().GetTextImport()->IsOrganizerMode() ||
+ GetImport().GetTextImport()->IsStylesOnlyMode() )
{
- Any aAny;
- aAny <<= nTmp;
- xPropertySet->setPropertyValue(sPropertyRevision, aAny);
+ ForceUpdate(rPropertySet);
+ }
+ else
+ {
+ sal_Int32 nTmp;
+ if (SvXMLUnitConverter::convertNumber(nTmp, GetContent()))
+ {
+ Any aAny;
+ aAny <<= nTmp;
+ rPropertySet->setPropertyValue(sPropertyRevision, aAny);
+ }
}
}
}
@@ -2030,7 +2113,9 @@ XMLHiddenParagraphImportContext::XMLHiddenParagraphImportContext(
XMLTextFieldImportContext(rImport, rHlp, sAPI_hidden_paragraph,
nPrfx, sLocalName),
sPropertyCondition(RTL_CONSTASCII_USTRINGPARAM(sAPI_condition)),
- sCondition()
+ sPropertyIsHidden(RTL_CONSTASCII_USTRINGPARAM(sAPI_is_hidden)),
+ sCondition(),
+ bIsHidden(sal_False)
{
}
@@ -2043,6 +2128,14 @@ void XMLHiddenParagraphImportContext::ProcessAttribute(
sCondition = sAttrValue;
bValid = sal_True;
}
+ else if (XML_TOK_TEXTFIELD_IS_HIDDEN == nAttrToken)
+ {
+ sal_Bool bTmp;
+ if (SvXMLUnitConverter::convertBool(bTmp, sAttrValue))
+ {
+ bIsHidden = bTmp;
+ }
+ }
}
void XMLHiddenParagraphImportContext::PrepareField(
@@ -2051,6 +2144,9 @@ void XMLHiddenParagraphImportContext::PrepareField(
Any aAny;
aAny <<= sCondition;
xPropertySet->setPropertyValue(sPropertyCondition, aAny);
+
+ aAny.setValue( &bIsHidden, ::getBooleanCppuType() );
+ xPropertySet->setPropertyValue(sPropertyIsHidden, aAny);
}
@@ -2069,12 +2165,14 @@ XMLConditionalTextImportContext::XMLConditionalTextImportContext(
sPropertyCondition(RTL_CONSTASCII_USTRINGPARAM(sAPI_condition)),
sPropertyTrueContent(RTL_CONSTASCII_USTRINGPARAM(sAPI_true_content)),
sPropertyFalseContent(RTL_CONSTASCII_USTRINGPARAM(sAPI_false_content)),
+ sPropertyIsConditionTrue(RTL_CONSTASCII_USTRINGPARAM(sAPI_is_condition_true)),
sCondition(),
sTrueContent(),
sFalseContent(),
bConditionOK(sal_False),
bTrueOK(sal_False),
- bFalseOK(sal_False)
+ bFalseOK(sal_False),
+ bCurrentValue(sal_False)
{
}
@@ -2096,6 +2194,15 @@ void XMLConditionalTextImportContext::ProcessAttribute(
sTrueContent = sAttrValue;
bTrueOK = sal_True;
break;
+ case XML_TOK_TEXTFIELD_CURRENT_VALUE:
+ {
+ sal_Bool bTmp;
+ if (SvXMLUnitConverter::convertBool(bTmp, sAttrValue))
+ {
+ bCurrentValue = bTmp;
+ }
+ break;
+ }
}
bValid = bConditionOK && bFalseOK && bTrueOK;
@@ -2114,6 +2221,9 @@ void XMLConditionalTextImportContext::PrepareField(
aAny <<= sTrueContent;
xPropertySet->setPropertyValue(sPropertyTrueContent, aAny);
+
+ aAny.setValue( &bCurrentValue, ::getBooleanCppuType() );
+ xPropertySet->setPropertyValue(sPropertyIsConditionTrue, aAny);
}
@@ -2131,10 +2241,12 @@ XMLHiddenTextImportContext::XMLHiddenTextImportContext(
nPrfx, sLocalName),
sPropertyCondition(RTL_CONSTASCII_USTRINGPARAM(sAPI_condition)),
sPropertyContent(RTL_CONSTASCII_USTRINGPARAM(sAPI_content)),
+ sPropertyIsHidden(RTL_CONSTASCII_USTRINGPARAM(sAPI_is_hidden)),
sCondition(),
sString(),
bConditionOK(sal_False),
- bStringOK(sal_False)
+ bStringOK(sal_False),
+ bIsHidden(sal_False)
{
}
@@ -2152,6 +2264,15 @@ void XMLHiddenTextImportContext::ProcessAttribute(
sString = sAttrValue;
bStringOK = sal_True;
break;
+ case XML_TOK_TEXTFIELD_IS_HIDDEN:
+ {
+ sal_Bool bTmp;
+ if (SvXMLUnitConverter::convertBool(bTmp, sAttrValue))
+ {
+ bIsHidden = bTmp;
+ }
+ break;
+ }
}
bValid = bConditionOK && bStringOK;
@@ -2167,6 +2288,9 @@ void XMLHiddenTextImportContext::PrepareField(
aAny <<= sString;
xPropertySet->setPropertyValue(sPropertyContent, aAny);
+
+ aAny.setValue( &bIsHidden, ::getBooleanCppuType() );
+ xPropertySet->setPropertyValue(sPropertyIsHidden, aAny);
}