summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorOcke Janssen <oj@openoffice.org>2002-08-22 06:36:10 +0000
committerOcke Janssen <oj@openoffice.org>2002-08-22 06:36:10 +0000
commit849f254c79e21af11667fed26180c99bed8a4378 (patch)
tree0b49cbbcd2d791733f9c0bfcedadab5ee5d44781 /xmloff
parentc31c66d15357ca4a2030193bf9733f411df786e7 (diff)
#99721# now save image url relative
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/forms/elementexport.cxx21
-rw-r--r--xmloff/source/forms/elementimport.cxx10
-rw-r--r--xmloff/source/forms/propertyexport.cxx18
-rw-r--r--xmloff/source/forms/propertyexport.hxx22
4 files changed, 53 insertions, 18 deletions
diff --git a/xmloff/source/forms/elementexport.cxx b/xmloff/source/forms/elementexport.cxx
index 121d7ec97803..91f992cc365e 100644
--- a/xmloff/source/forms/elementexport.cxx
+++ b/xmloff/source/forms/elementexport.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: elementexport.cxx,v $
*
- * $Revision: 1.21 $
+ * $Revision: 1.22 $
*
- * last change: $Author: fs $ $Date: 2001-11-02 11:45:36 $
+ * last change: $Author: oj $ $Date: 2002-08-22 07:36:10 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -461,12 +461,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_TITLE
+ 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_TITLE
+ PROPERTY_LABEL, PROPERTY_TITLE
};
OSL_ENSURE( sizeof(pStringPropertyNames)/sizeof(pStringPropertyNames[0]) ==
sizeof(nStringPropertyAttributeIds)/sizeof(nStringPropertyAttributeIds[0]),
@@ -603,6 +603,16 @@ namespace xmloff
#endif
}
+ // OJ #99721#
+ if (m_nIncludeCommon & CCA_IMAGE_DATA)
+ {
+ exportImageDataAttribute();
+ #ifdef DBG_UTIL
+ // reset the bit for later checking
+ m_nIncludeCommon = m_nIncludeCommon & ~CCA_IMAGE_DATA;
+ #endif
+ }
+
// the for attribute
// the target frame
if (m_nIncludeCommon & CCA_FOR)
@@ -1543,6 +1553,9 @@ namespace xmloff
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
+ * Revision 1.21 2001/11/02 11:45:36 fs
+ * #94196# do not export the only ListSource element in case of a non-valuelist-ListBox
+ *
* Revision 1.20 2001/10/12 16:30:53 hr
* #92830#: required change: std::min()/std::max()
*
diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx
index 021dc03fe9b1..d5710b4cb574 100644
--- a/xmloff/source/forms/elementimport.cxx
+++ b/xmloff/source/forms/elementimport.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: elementimport.cxx,v $
*
- * $Revision: 1.27 $
+ * $Revision: 1.28 $
*
- * last change: $Author: fs $ $Date: 2001-12-12 16:35:19 $
+ * last change: $Author: oj $ $Date: 2002-08-22 07:36:10 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -726,7 +726,8 @@ namespace xmloff
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)
+ static const ::rtl::OUString s_sImageDataAttributeName = ::rtl::OUString::createFromAscii(getCommonControlAttributeName(CCA_IMAGE_DATA));
+ if ( (s_sTargetLocationAttributeName == _rLocalName) || (s_sImageDataAttributeName == _rLocalName) )
{
// make a global URL out of the local one
::rtl::OUString sAdjustedValue = m_rContext.getGlobalContext().GetAbsoluteReference(_rValue);
@@ -1308,6 +1309,9 @@ namespace xmloff
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
+ * Revision 1.27 2001/12/12 16:35:19 fs
+ * #95892# moved the assertion in ListAndComboImport::EndElement to the proper place
+ *
* Revision 1.26 2001/11/02 12:34:13 fs
* #94196# in case of a non-valuelist-ListBox, do not import the ListSource property twice
*
diff --git a/xmloff/source/forms/propertyexport.cxx b/xmloff/source/forms/propertyexport.cxx
index bff410d53962..b03e6b664e9e 100644
--- a/xmloff/source/forms/propertyexport.cxx
+++ b/xmloff/source/forms/propertyexport.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: propertyexport.cxx,v $
*
- * $Revision: 1.18 $
+ * $Revision: 1.19 $
*
- * last change: $Author: fs $ $Date: 2001-06-25 13:32:38 $
+ * last change: $Author: oj $ $Date: 2002-08-22 07:36:10 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -528,17 +528,16 @@ namespace xmloff
}
//---------------------------------------------------------------------
- void OPropertyExport::exportTargetLocationAttribute()
+ void OPropertyExport::exportRelativeTargetLocation(const ConstAsciiString& _sPropertyName,sal_Int32 _nProperty)
{
- DBG_CHECK_PROPERTY((const sal_Char*)PROPERTY_TARGETURL, ::rtl::OUString);
+ DBG_CHECK_PROPERTY((const sal_Char*)_sPropertyName, ::rtl::OUString);
- ::rtl::OUString sTargetLocation = comphelper::getString(m_xProps->getPropertyValue(PROPERTY_TARGETURL));
+ ::rtl::OUString sTargetLocation = comphelper::getString(m_xProps->getPropertyValue(_sPropertyName));
sTargetLocation = m_rContext.getGlobalContext().GetRelativeReference(sTargetLocation);
- AddAttribute(getCommonControlAttributeNamespace(CCA_TARGET_LOCATION), getCommonControlAttributeName(CCA_TARGET_LOCATION), sTargetLocation);
+ AddAttribute(getCommonControlAttributeNamespace(_nProperty), getCommonControlAttributeName(_nProperty), sTargetLocation);
- exportedProperty(PROPERTY_TARGETURL);
+ exportedProperty(_sPropertyName);
}
-
//---------------------------------------------------------------------
void OPropertyExport::flagStyleProperties()
{
@@ -808,6 +807,9 @@ namespace xmloff
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
+ * Revision 1.18 2001/06/25 13:32:38 fs
+ * #88691# TargetURL property value must be saved relative to own document
+ *
* 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
*
diff --git a/xmloff/source/forms/propertyexport.hxx b/xmloff/source/forms/propertyexport.hxx
index 5f7ff9a93324..d4aa184da3ba 100644
--- a/xmloff/source/forms/propertyexport.hxx
+++ b/xmloff/source/forms/propertyexport.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: propertyexport.hxx,v $
*
- * $Revision: 1.13 $
+ * $Revision: 1.14 $
*
- * last change: $Author: fs $ $Date: 2001-06-25 13:32:38 $
+ * last change: $Author: oj $ $Date: 2002-08-22 07:36:10 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -80,6 +80,9 @@
#ifndef _XMLOFF_FORMS_CALLBACKS_HXX_
#include "callbacks.hxx"
#endif
+#ifndef _XMLOFF_FORMS_STRINGS_HXX_
+#include "strings.hxx"
+#endif
//.........................................................................
namespace xmloff
@@ -114,6 +117,8 @@ namespace xmloff
StringSet m_aRemainingProps;
// see examinePersistence
+ void exportRelativeTargetLocation(const ConstAsciiString& _sPropertyName,sal_Int32 _nProperty);
+
protected:
IFormsExportContext& m_rContext;
@@ -254,7 +259,15 @@ namespace xmloff
<p>The property needs a special handling because the URL's need to be made relative</p>
*/
- void exportTargetLocationAttribute();
+ inline void exportTargetLocationAttribute() { exportRelativeTargetLocation(PROPERTY_TARGETURL,CCA_TARGET_LOCATION); }
+
+ /** add the form:image attribute to the export context.
+
+ <p>The value of this attribute is extracted from the ImageURL property of the object given.</p>
+
+ <p>The property needs a special handling because the URL's need to be made relative</p>
+ */
+ inline void exportImageDataAttribute() { exportRelativeTargetLocation(PROPERTY_IMAGEURL,CCA_IMAGE_DATA); }
/** flag the style properties as 'already exported'
@@ -412,6 +425,9 @@ namespace xmloff
/*************************************************************************
* history:
* $Log: not supported by cvs2svn $
+ * Revision 1.13 2001/06/25 13:32:38 fs
+ * #88691# TargetURL property value must be saved relative to own document
+ *
* Revision 1.12 2001/04/17 07:58:12 fs
* #85427# +_bVoidDefault parameter for addEnumPropertyAttribute
*