summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorFrank Schönheit <fs@openoffice.org>2001-06-25 12:32:38 +0000
committerFrank Schönheit <fs@openoffice.org>2001-06-25 12:32:38 +0000
commit099b60a10744f2ee7f21a150a1ac9ae351051c18 (patch)
tree1c7224a61104be90a83233732dc7b846ecfb2556 /xmloff
parentbfbfe5c3689d84587973c5b0fd90503c775e7bd3 (diff)
#88691# TargetURL property value must be saved relative to own document
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/forms/elementexport.cxx22
-rw-r--r--xmloff/source/forms/elementimport.cxx21
-rw-r--r--xmloff/source/forms/elementimport.hxx13
-rw-r--r--xmloff/source/forms/propertyexport.cxx19
-rw-r--r--xmloff/source/forms/propertyexport.hxx17
5 files changed, 79 insertions, 13 deletions
diff --git a/xmloff/source/forms/elementexport.cxx b/xmloff/source/forms/elementexport.cxx
index 4c0ba07f7631..5379a943dbe0 100644
--- a/xmloff/source/forms/elementexport.cxx
+++ b/xmloff/source/forms/elementexport.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: elementexport.cxx,v $
*
- * $Revision: 1.17 $
+ * $Revision: 1.18 $
*
- * last change: $Author: fs $ $Date: 2001-06-14 13:39:35 $
+ * last change: $Author: fs $ $Date: 2001-06-25 13:32:38 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -459,12 +459,12 @@ namespace xmloff
// the attribute ids of all properties which are expected to be of type string
static sal_Int32 nStringPropertyAttributeIds[] =
{
- CCA_IMAGE_DATA, CCA_LABEL, CCA_TARGET_LOCATION, CCA_TITLE
+ CCA_IMAGE_DATA, CCA_LABEL, CCA_TITLE
};
// the names of all properties which are expected to be of type string
static const sal_Char* pStringPropertyNames[] =
{
- PROPERTY_IMAGEURL, PROPERTY_LABEL, PROPERTY_TARGETURL, PROPERTY_TITLE
+ PROPERTY_IMAGEURL, PROPERTY_LABEL, PROPERTY_TITLE
};
OSL_ENSURE( sizeof(pStringPropertyNames)/sizeof(pStringPropertyNames[0]) ==
sizeof(nStringPropertyAttributeIds)/sizeof(nStringPropertyAttributeIds[0]),
@@ -592,6 +592,15 @@ namespace xmloff
#endif
}
+ if (m_nIncludeCommon & CCA_TARGET_LOCATION)
+ {
+ exportTargetLocationAttribute();
+ #ifdef DBG_UTIL
+ // reset the bit for later checking
+ m_nIncludeCommon = m_nIncludeCommon & ~CCA_TARGET_LOCATION;
+ #endif
+ }
+
// the for attribute
// the target frame
if (m_nIncludeCommon & CCA_FOR)
@@ -1505,6 +1514,8 @@ namespace xmloff
exportServiceNameAttribute();
// the target frame
exportTargetFrameAttribute();
+ // the target URL
+ exportTargetLocationAttribute();
// master fields
exportStringSequenceAttribute(
@@ -1525,6 +1536,9 @@ namespace xmloff
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
+ * Revision 1.17 2001/06/14 13:39:35 fs
+ * #88016# corrected the condition for the assertion
+ *
* Revision 1.16 2001/05/21 13:30:17 fs
* #85388# when exporting the ListSource as attribs, store form:option elements as long as there are valid 'selected' or 'default-selected' entries
*
diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx
index 62da997a1390..6bfd93bbd5c8 100644
--- a/xmloff/source/forms/elementimport.cxx
+++ b/xmloff/source/forms/elementimport.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: elementimport.cxx,v $
*
- * $Revision: 1.22 $
+ * $Revision: 1.23 $
*
- * last change: $Author: fs $ $Date: 2001-05-21 13:33:04 $
+ * last change: $Author: fs $ $Date: 2001-06-25 13:32:38 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -718,6 +718,20 @@ namespace xmloff
simluateDefaultedAttribute(getCommonControlAttributeName(CCA_TARGET_FRAME), PROPERTY_TARGETFRAME, "_blank");
}
+ //---------------------------------------------------------------------
+ void OButtonImport::handleAttribute(sal_uInt16 _nNamespaceKey, const ::rtl::OUString& _rLocalName, const ::rtl::OUString& _rValue)
+ {
+ static const ::rtl::OUString s_sTargetLocationAttributeName = ::rtl::OUString::createFromAscii(getCommonControlAttributeName(CCA_TARGET_LOCATION));
+ if (s_sTargetLocationAttributeName == _rLocalName)
+ {
+ // make a global URL out of the local one
+ ::rtl::OUString sAdjustedValue = m_rContext.getGlobalContext().GetAbsoluteReference(_rValue);
+ OControlImport::handleAttribute(_nNamespaceKey, _rLocalName, sAdjustedValue);
+ }
+ else
+ OControlImport::handleAttribute(_nNamespaceKey, _rLocalName, _rValue);
+ }
+
//=====================================================================
//= OTextLikeImport
//=====================================================================
@@ -1264,6 +1278,9 @@ namespace xmloff
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
+ * Revision 1.22 2001/05/21 13:33:04 fs
+ * #85388# when exporting the ListSource as attribs, store form:option elements as long as there are valid 'selected' or 'default-selected' entries
+ *
* Revision 1.21 2001/05/17 12:40:01 fs
* #86895# #86825# implTranslateValueProperty: special handling for EffectiveValue and EffectiveDefault
*
diff --git a/xmloff/source/forms/elementimport.hxx b/xmloff/source/forms/elementimport.hxx
index 457338801e21..a88865c25b83 100644
--- a/xmloff/source/forms/elementimport.hxx
+++ b/xmloff/source/forms/elementimport.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: elementimport.hxx,v $
*
- * $Revision: 1.12 $
+ * $Revision: 1.13 $
*
- * last change: $Author: fs $ $Date: 2001-05-21 13:33:48 $
+ * last change: $Author: fs $ $Date: 2001-06-25 13:32:38 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -338,6 +338,7 @@ namespace xmloff
OControlElement::ElementType _eType
);
+ protected:
// OPropertyImport overridables
virtual void handleAttribute(sal_uInt16 _nNamespaceKey,
const ::rtl::OUString& _rLocalName,
@@ -363,6 +364,11 @@ namespace xmloff
// SvXMLImportContext overridables
virtual void StartElement(
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& _rxAttrList);
+
+ // OPropertyImport overridables
+ virtual void handleAttribute(sal_uInt16 _nNamespaceKey,
+ const ::rtl::OUString& _rLocalName,
+ const ::rtl::OUString& _rValue);
};
//=====================================================================
@@ -631,6 +637,9 @@ namespace xmloff
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
+ * Revision 1.12 2001/05/21 13:33:48 fs
+ * #85388# +m_nEmptyXXXItems/+implEmptyXXXFound
+ *
* Revision 1.11 2001/03/29 09:45:16 fs
* #85386# +OTextLikeImport / handle attributes which's defaults differ from the property defaults
*
diff --git a/xmloff/source/forms/propertyexport.cxx b/xmloff/source/forms/propertyexport.cxx
index 6fc5f484b0a5..bff410d53962 100644
--- a/xmloff/source/forms/propertyexport.cxx
+++ b/xmloff/source/forms/propertyexport.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: propertyexport.cxx,v $
*
- * $Revision: 1.17 $
+ * $Revision: 1.18 $
*
- * last change: $Author: fs $ $Date: 2001-05-28 15:00:42 $
+ * last change: $Author: fs $ $Date: 2001-06-25 13:32:38 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -528,6 +528,18 @@ namespace xmloff
}
//---------------------------------------------------------------------
+ void OPropertyExport::exportTargetLocationAttribute()
+ {
+ DBG_CHECK_PROPERTY((const sal_Char*)PROPERTY_TARGETURL, ::rtl::OUString);
+
+ ::rtl::OUString sTargetLocation = comphelper::getString(m_xProps->getPropertyValue(PROPERTY_TARGETURL));
+ sTargetLocation = m_rContext.getGlobalContext().GetRelativeReference(sTargetLocation);
+ AddAttribute(getCommonControlAttributeNamespace(CCA_TARGET_LOCATION), getCommonControlAttributeName(CCA_TARGET_LOCATION), sTargetLocation);
+
+ exportedProperty(PROPERTY_TARGETURL);
+ }
+
+ //---------------------------------------------------------------------
void OPropertyExport::flagStyleProperties()
{
// flag all the properties which are part of the style as "handled"
@@ -796,6 +808,9 @@ namespace xmloff
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
+ * Revision 1.17 2001/05/28 15:00:42 fs
+ * #86712# don't export DateFormat and TimeFormat directly anymore - the format settings are stored as style now
+ *
* Revision 1.16 2001/04/17 07:58:12 fs
* #85427# +_bVoidDefault parameter for addEnumPropertyAttribute
*
diff --git a/xmloff/source/forms/propertyexport.hxx b/xmloff/source/forms/propertyexport.hxx
index 71001a5dabbb..5f7ff9a93324 100644
--- a/xmloff/source/forms/propertyexport.hxx
+++ b/xmloff/source/forms/propertyexport.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: propertyexport.hxx,v $
*
- * $Revision: 1.12 $
+ * $Revision: 1.13 $
*
- * last change: $Author: fs $ $Date: 2001-04-17 07:58:12 $
+ * last change: $Author: fs $ $Date: 2001-06-25 13:32:38 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -239,7 +239,7 @@ namespace xmloff
// some very special methods for some very special attribute/property pairs
- /** add the hlink:xref attribute to the export context.
+ /** add the hlink:target-frame attribute to the export context.
<p>The value of this attribute is extracted from the TargetFrame property of the object given.</p>
@@ -248,6 +248,14 @@ namespace xmloff
*/
void exportTargetFrameAttribute();
+ /** add the form:href attribute to the export context.
+
+ <p>The value of this attribute is extracted from the TargetURL property of the object given.</p>
+
+ <p>The property needs a special handling because the URL's need to be made relative</p>
+ */
+ void exportTargetLocationAttribute();
+
/** flag the style properties as 'already exported'
<p>We don't have style support right now, so the only thing the method does is removing the style-relevant
@@ -404,6 +412,9 @@ namespace xmloff
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
+ * Revision 1.12 2001/04/17 07:58:12 fs
+ * #85427# +_bVoidDefault parameter for addEnumPropertyAttribute
+ *
* Revision 1.11 2001/03/29 12:18:58 fs
* #85097# when exporting boolean properties, allow for MAYBEVOID props
*