summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/inc/xmlnmspe.hxx10
-rw-r--r--xmloff/inc/xmloff/xmltoken.hxx4
-rw-r--r--xmloff/source/core/xmlexp.cxx1
-rw-r--r--xmloff/source/core/xmlimp.cxx4
-rw-r--r--xmloff/source/core/xmltoken.cxx4
-rw-r--r--xmloff/source/draw/sdxmlexp.cxx131
-rw-r--r--xmloff/source/draw/sdxmlexp_impl.hxx3
-rw-r--r--xmloff/source/draw/ximppage.cxx164
-rw-r--r--xmloff/source/draw/ximppage.hxx4
-rw-r--r--xmloff/source/meta/MetaExportComponent.cxx1
10 files changed, 305 insertions, 21 deletions
diff --git a/xmloff/inc/xmlnmspe.hxx b/xmloff/inc/xmlnmspe.hxx
index a79890f19a7d..f90ff05c084d 100644
--- a/xmloff/inc/xmlnmspe.hxx
+++ b/xmloff/inc/xmlnmspe.hxx
@@ -82,7 +82,15 @@ XML_NAMESPACE( OF, 34U ) // OpenFormula aka ODFF
XML_NAMESPACE( XHTML, 35U )
XML_NAMESPACE( GRDDL, 36U )
-#define _XML_OLD_NAMESPACE_BASE 37U
+// namespaces for odf extended formats
+
+#define XML_NAMESPACE_EXT( prefix, key ) \
+const sal_uInt16 XML_NAMESPACE_##prefix##_EXT = key; \
+const sal_uInt16 XML_NAMESPACE_##prefix##_EXT_IDX = key;
+
+XML_NAMESPACE_EXT( OFFICE, 37U )
+
+#define _XML_OLD_NAMESPACE_BASE 38U
// namespaces used in the technical preview (SO 5.2)
XML_OLD_NAMESPACE( FO, 0U )
diff --git a/xmloff/inc/xmloff/xmltoken.hxx b/xmloff/inc/xmloff/xmltoken.hxx
index 978f6e698cc8..70e8ed82ca49 100644
--- a/xmloff/inc/xmloff/xmltoken.hxx
+++ b/xmloff/inc/xmloff/xmltoken.hxx
@@ -144,6 +144,10 @@ namespace xmloff { namespace token {
XML_NP_GRDDL,
XML_N_GRDDL,
+ // ODF Enhanced namespaces
+ XML_NP_OFFICE_EXT,
+ XML_N_OFFICE_EXT,
+
// units
XML_UNIT_MM,
XML_UNIT_M,
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index 8045cd582e2f..55af99802f9d 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -1358,6 +1358,7 @@ sal_uInt32 SvXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass )
const sal_Char* pVersion = 0;
switch( getDefaultVersion() )
{
+ case SvtSaveOptions::ODFVER_LATEST: pVersion = sXML_1_2; break;
case SvtSaveOptions::ODFVER_012: pVersion = sXML_1_2; break;
case SvtSaveOptions::ODFVER_011: pVersion = sXML_1_1; break;
case SvtSaveOptions::ODFVER_010: break;
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index 975cb5432eb7..72ae06150243 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -89,6 +89,7 @@ using namespace ::com::sun::star::document;
using namespace ::xmloff::token;
sal_Char __READONLY_DATA sXML_np__office[] = "_office";
+sal_Char __READONLY_DATA sXML_np__office_ext[] = "_office_ooo";
sal_Char __READONLY_DATA sXML_np__ooo[] = "_ooo";
sal_Char __READONLY_DATA sXML_np__ooow[] = "_ooow";
sal_Char __READONLY_DATA sXML_np__oooc[] = "_oooc";
@@ -241,6 +242,9 @@ void SvXMLImport::_InitCtor()
mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__office ) ),
GetXMLToken(XML_N_OFFICE),
XML_NAMESPACE_OFFICE );
+ mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__office_ext ) ),
+ GetXMLToken(XML_N_OFFICE_EXT),
+ XML_NAMESPACE_OFFICE_EXT );
mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__ooo ) ), GetXMLToken(XML_N_OOO), XML_NAMESPACE_OOO );
mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__style) ),
GetXMLToken(XML_N_STYLE),
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index d4f60e053b3c..ae95763f1936 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -152,6 +152,10 @@ namespace xmloff { namespace token {
TOKEN( "grddl", XML_NP_GRDDL ),
TOKEN( "http://www.w3.org/2003/g/data-view#", XML_N_GRDDL ),
+ // ODF Enhanced namespaces
+ TOKEN( "officeooo", XML_NP_OFFICE_EXT ),
+ TOKEN( "http://openoffice.org/2009/office", XML_N_OFFICE_EXT ),
+
// units
TOKEN( "mm", XML_UNIT_MM ),
TOKEN( "m", XML_UNIT_M ),
diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx
index 67c66b6a1d5f..1d7414d4ca23 100644
--- a/xmloff/source/draw/sdxmlexp.cxx
+++ b/xmloff/source/draw/sdxmlexp.cxx
@@ -39,7 +39,9 @@
#include <com/sun/star/lang/ServiceNotRegisteredException.hpp>
#include <com/sun/star/presentation/XPresentationSupplier.hpp>
#include <com/sun/star/presentation/XCustomPresentationSupplier.hpp>
+#include <com/sun/star/geometry/RealPoint2D.hpp>
#include <com/sun/star/task/XStatusIndicatorSupplier.hpp>
+#include <com/sun/star/office/XAnnotationAccess.hpp>
#include <com/sun/star/lang/Locale.hpp>
#include <com/sun/star/uno/Any.hxx>
#include "sdxmlexp_impl.hxx"
@@ -51,9 +53,7 @@
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
#include <com/sun/star/style/XStyle.hpp>
-#ifndef _COM_SUN_STAR_FORM_XFORMSUPPLIER2_HPP_
#include <com/sun/star/form/XFormsSupplier2.hpp>
-#endif
#include <com/sun/star/presentation/XPresentationPage.hpp>
#include <com/sun/star/drawing/XMasterPageTarget.hpp>
#include <com/sun/star/text/XText.hpp>
@@ -96,9 +96,13 @@ using ::rtl::OUStringBuffer;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::util;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::drawing;
+using namespace ::com::sun::star::office;
using namespace ::com::sun::star::presentation;
+using namespace ::com::sun::star::geometry;
+using namespace ::com::sun::star::text;
using namespace ::xmloff::token;
@@ -640,6 +644,14 @@ void SAL_CALL SdXMLExport::setSourceDocument( const Reference< lang::XComponent
GetXMLToken(XML_N_ANIMATION),
XML_NAMESPACE_ANIMATION);
+ if( getDefaultVersion() == SvtSaveOptions::ODFVER_LATEST )
+ {
+ _GetNamespaceMap().Add(
+ GetXMLToken(XML_NP_OFFICE_EXT),
+ GetXMLToken(XML_N_OFFICE_EXT),
+ XML_NAMESPACE_OFFICE_EXT);
+ }
+
GetShapeExport()->enableLayerExport();
// #88546# enable progress bar increments
@@ -2060,6 +2072,8 @@ void SdXMLExport::_ExportContent()
}
}
}
+
+ exportAnnotations( xDrawPage );
}
}
@@ -2355,10 +2369,9 @@ void SdXMLExport::_ExportAutoStyles()
// create auto style infos for objects on master pages
for(sal_Int32 nMPageId(0L); nMPageId < mnDocMasterPageCount; nMPageId++)
{
- Any aAny(mxDocMasterPages->getByIndex(nMPageId));
- Reference< XDrawPage > xMasterPage;
+ Reference< XDrawPage > xMasterPage(mxDocMasterPages->getByIndex(nMPageId), UNO_QUERY );
- if((aAny >>= xMasterPage) && xMasterPage.is() )
+ if( xMasterPage.is() )
{
// collect layer information
GetFormExport()->examineForms( xMasterPage );
@@ -2397,6 +2410,7 @@ void SdXMLExport::_ExportAutoStyles()
}
}
}
+ collectAnnotationAutoStyles(xMasterPage);
}
}
}
@@ -2413,10 +2427,8 @@ void SdXMLExport::_ExportAutoStyles()
// create auto style infos for objects on pages
for(sal_Int32 nPageInd(0); nPageInd < mnDocDrawPageCount; nPageInd++)
{
- Any aAny(mxDocDrawPages->getByIndex(nPageInd));
- Reference<XDrawPage> xDrawPage;
-
- if((aAny >>= xDrawPage) && xDrawPage.is() )
+ Reference<XDrawPage> xDrawPage( mxDocDrawPages->getByIndex(nPageInd), UNO_QUERY );
+ if( xDrawPage.is() )
{
// collect layer information
GetFormExport()->examineForms( xDrawPage );
@@ -2466,6 +2478,8 @@ void SdXMLExport::_ExportAutoStyles()
}
}
}
+
+ collectAnnotationAutoStyles( xDrawPage );
}
}
if(IsImpress())
@@ -2536,10 +2550,8 @@ void SdXMLExport::_ExportMasterStyles()
// export MasterPages in master-styles section
for(sal_Int32 nMPageId = 0L; nMPageId < mnDocMasterPageCount; nMPageId++)
{
- Any aAny(mxDocMasterPages->getByIndex(nMPageId));
- Reference< XDrawPage > xMasterPage;
-
- if((aAny >>= xMasterPage) && xMasterPage.is())
+ Reference< XDrawPage > xMasterPage( mxDocMasterPages->getByIndex(nMPageId), UNO_QUERY );
+ if(xMasterPage.is())
{
// prepare masterpage attributes
OUString sMasterPageName;
@@ -2610,6 +2622,7 @@ void SdXMLExport::_ExportMasterStyles()
}
}
}
+ exportAnnotations( xMasterPage );
}
}
}
@@ -2770,6 +2783,98 @@ OUString SdXMLExport::getNavigationOrder( const Reference< XDrawPage >& xDrawPag
//////////////////////////////////////////////////////////////////////////////
+void SdXMLExport::collectAnnotationAutoStyles( const Reference<XDrawPage>& xDrawPage )
+{
+ Reference< XAnnotationAccess > xAnnotationAccess( xDrawPage, UNO_QUERY );
+ if( xAnnotationAccess.is() ) try
+ {
+ Reference< XAnnotationEnumeration > xAnnotationEnumeration( xAnnotationAccess->createAnnotationEnumeration() );
+ if( xAnnotationEnumeration.is() )
+ {
+ while( xAnnotationEnumeration->hasMoreElements() )
+ {
+ Reference< XAnnotation > xAnnotation( xAnnotationEnumeration->nextElement(), UNO_QUERY_THROW );
+ Reference< XText > xText( xAnnotation->getTextRange() );
+ if(xText.is() && xText->getString().getLength())
+ GetTextParagraphExport()->collectTextAutoStyles( xText );
+ }
+ }
+ }
+ catch( Exception& )
+ {
+ DBG_ERROR("SdXMLExport::collectAnnotationAutoStyles(), exception caught during export of annotation auto styles");
+ }
+}
+
+void SdXMLExport::exportAnnotations( const Reference<XDrawPage>& xDrawPage )
+{
+ // do not export in ODF 1.2 or older
+ if( getDefaultVersion() != SvtSaveOptions::ODFVER_LATEST )
+ return;
+
+ Reference< XAnnotationAccess > xAnnotationAccess( xDrawPage, UNO_QUERY );
+ if( xAnnotationAccess.is() ) try
+ {
+ Reference< XAnnotationEnumeration > xAnnotationEnumeration( xAnnotationAccess->createAnnotationEnumeration() );
+ if( xAnnotationEnumeration.is() && xAnnotationEnumeration->hasMoreElements() )
+ {
+ OUStringBuffer sStringBuffer;
+ do
+ {
+ Reference< XAnnotation > xAnnotation( xAnnotationEnumeration->nextElement(), UNO_QUERY_THROW );
+
+ RealPoint2D aPosition( xAnnotation->getPosition() );
+
+ GetMM100UnitConverter().convertMeasure(sStringBuffer, static_cast<sal_Int32>( aPosition.X * 100 ) );
+ AddAttribute(XML_NAMESPACE_SVG, XML_X, sStringBuffer.makeStringAndClear());
+
+ GetMM100UnitConverter().convertMeasure(sStringBuffer, static_cast<sal_Int32>( aPosition.Y * 100 ) );
+ AddAttribute(XML_NAMESPACE_SVG, XML_Y, sStringBuffer.makeStringAndClear());
+
+ RealSize2D aSize( xAnnotation->getSize() );
+
+ if( aSize.Width || aSize.Height )
+ {
+ GetMM100UnitConverter().convertMeasure(sStringBuffer, static_cast<sal_Int32>( aSize.Width * 100 ) );
+ AddAttribute(XML_NAMESPACE_SVG, XML_WIDTH, sStringBuffer.makeStringAndClear());
+ GetMM100UnitConverter().convertMeasure(sStringBuffer, static_cast<sal_Int32>( aSize.Height * 100 ) );
+ AddAttribute(XML_NAMESPACE_SVG, XML_HEIGHT, sStringBuffer.makeStringAndClear());
+ }
+
+ // annotation element + content
+ SvXMLElementExport aElem(*this, XML_NAMESPACE_OFFICE_EXT, XML_ANNOTATION, sal_False, sal_True);
+
+ // author
+ OUString aAuthor( xAnnotation->getAuthor() );
+ if( aAuthor.getLength() )
+ {
+ SvXMLElementExport aCreatorElem( *this, XML_NAMESPACE_DC, XML_CREATOR, sal_True, sal_False );
+ this->Characters(aAuthor);
+ }
+
+ {
+ // date time
+ DateTime aDate( xAnnotation->getDateTime() );
+ GetMM100UnitConverter().convertDateTime(sStringBuffer, aDate, sal_True);
+ SvXMLElementExport aDateElem( *this, XML_NAMESPACE_DC, XML_DATE, sal_True, sal_False );
+ Characters(sStringBuffer.makeStringAndClear());
+ }
+
+ com::sun::star::uno::Reference < com::sun::star::text::XText > xText( xAnnotation->getTextRange() );
+ if( xText.is() )
+ this->GetTextParagraphExport()->exportText( xText );
+ }
+ while( xAnnotationEnumeration->hasMoreElements() );
+ }
+ }
+ catch( Exception& )
+ {
+ DBG_ERROR("SdXMLExport::exportAnnotations(), exception caught during export of annotations");
+ }
+}
+
+//////////////////////////////////////////////////////////////////////////////
+
#define SERVICE( classname, servicename, implementationname, draw, flags )\
uno::Sequence< OUString > SAL_CALL classname##_getSupportedServiceNames() throw()\
{\
diff --git a/xmloff/source/draw/sdxmlexp_impl.hxx b/xmloff/source/draw/sdxmlexp_impl.hxx
index eaf5c7c531f2..2738e948ea69 100644
--- a/xmloff/source/draw/sdxmlexp_impl.hxx
+++ b/xmloff/source/draw/sdxmlexp_impl.hxx
@@ -186,6 +186,9 @@ class SdXMLExport : public SvXMLExport
rtl::OUString getNavigationOrder( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& xDrawPage );
+ void collectAnnotationAutoStyles( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& xDrawPage );
+ void exportAnnotations( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& xDrawPage );
+
protected:
virtual void GetViewSettings(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aProps);
virtual void GetConfigurationSettings(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aProps);
diff --git a/xmloff/source/draw/ximppage.cxx b/xmloff/source/draw/ximppage.cxx
index 4daa6263d391..9d64d49f9421 100644
--- a/xmloff/source/draw/ximppage.cxx
+++ b/xmloff/source/draw/ximppage.cxx
@@ -32,6 +32,9 @@
#include "precompiled_xmloff.hxx"
#include <tools/debug.hxx>
+#include <com/sun/star/geometry/RealPoint2D.hpp>
+#include <com/sun/star/text/XTextCursor.hpp>
+#include <com/sun/star/util/DateTime.hpp>
#include <cppuhelper/implbase1.hxx>
#include "XMLNumberStylesImport.hxx"
#include <xmloff/xmlstyle.hxx>
@@ -41,6 +44,7 @@
#include "ximppage.hxx"
#include "ximpshap.hxx"
#include "animimp.hxx"
+#include "XMLStringBufferImportContext.hxx"
#include <xmloff/formsimp.hxx>
#include <xmloff/xmlictxt.hxx>
#include "ximpstyl.hxx"
@@ -57,9 +61,155 @@ using namespace ::com::sun::star;
using namespace ::xmloff::token;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::text;
+using namespace ::com::sun::star::util;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::drawing;
using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::office;
+using namespace ::com::sun::star::xml::sax;
+using namespace ::com::sun::star::geometry;
+
+
+//////////////////////////////////////////////////////////////////////////////
+
+class DrawAnnotationContext : public SvXMLImportContext
+{
+
+public:
+ DrawAnnotationContext( SvXMLImport& rImport, USHORT nPrfx, const OUString& rLocalName,const Reference< xml::sax::XAttributeList>& xAttrList, const Reference< XAnnotationAccess >& xAnnotationAccess );
+
+ virtual SvXMLImportContext * CreateChildContext( USHORT nPrefix, const ::rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList );
+ virtual void EndElement();
+
+private:
+ Reference< XAnnotation > mxAnnotation;
+ Reference< XTextCursor > mxCursor;
+
+ OUStringBuffer maAuthorBuffer;
+ OUStringBuffer maDateBuffer;
+};
+
+DrawAnnotationContext::DrawAnnotationContext( SvXMLImport& rImport, USHORT nPrfx, const OUString& rLocalName,const Reference< xml::sax::XAttributeList>& xAttrList, const Reference< XAnnotationAccess >& xAnnotationAccess )
+: SvXMLImportContext( rImport, nPrfx, rLocalName )
+, mxAnnotation( xAnnotationAccess->createAndInsertAnnotation() )
+{
+ if( mxAnnotation.is() )
+ {
+ sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
+
+ RealPoint2D aPosition;
+ RealSize2D aSize;
+
+ for(sal_Int16 i=0; i < nAttrCount; i++)
+ {
+ OUString sValue( xAttrList->getValueByIndex( i ) );
+ OUString sAttrName( xAttrList->getNameByIndex( i ) );
+ OUString aLocalName;
+ switch( GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ) )
+ {
+ case XML_NAMESPACE_SVG:
+ if( IsXMLToken( aLocalName, XML_X ) )
+ {
+ sal_Int32 x;
+ GetImport().GetMM100UnitConverter().convertMeasure(x, sValue);
+ aPosition.X = static_cast<double>(x) / 100.0;
+ }
+ else if( IsXMLToken( aLocalName, XML_Y ) )
+ {
+ sal_Int32 y;
+ GetImport().GetMM100UnitConverter().convertMeasure(y, sValue);
+ aPosition.Y = static_cast<double>(y) / 100.0;
+ }
+ else if( IsXMLToken( aLocalName, XML_WIDTH ) )
+ {
+ sal_Int32 w;
+ GetImport().GetMM100UnitConverter().convertMeasure(w, sValue);
+ aSize.Width = static_cast<double>(w) / 100.0;
+ }
+ else if( IsXMLToken( aLocalName, XML_HEIGHT ) )
+ {
+ sal_Int32 h;
+ GetImport().GetMM100UnitConverter().convertMeasure(h, sValue);
+ aSize.Height = static_cast<double>(h) / 100.0;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ mxAnnotation->setPosition( aPosition );
+ mxAnnotation->setSize( aSize );
+ }
+}
+
+SvXMLImportContext * DrawAnnotationContext::CreateChildContext( USHORT nPrefix, const OUString& rLocalName, const Reference< XAttributeList >& xAttrList )
+{
+ SvXMLImportContext * pContext = NULL;
+
+ if( mxAnnotation.is() )
+ {
+ if( XML_NAMESPACE_DC == nPrefix )
+ {
+ if( IsXMLToken( rLocalName, XML_CREATOR ) )
+ pContext = new XMLStringBufferImportContext(GetImport(), nPrefix, rLocalName, maAuthorBuffer);
+ else if( IsXMLToken( rLocalName, XML_DATE ) )
+ pContext = new XMLStringBufferImportContext(GetImport(), nPrefix, rLocalName, maDateBuffer);
+ }
+ else
+ {
+ // create text cursor on demand
+ if( !mxCursor.is() )
+ {
+ uno::Reference< text::XText > xText( mxAnnotation->getTextRange() );
+ if( xText.is() )
+ {
+ UniReference < XMLTextImportHelper > xTxtImport = GetImport().GetTextImport();
+ mxCursor = xText->createTextCursor();
+ if( mxCursor.is() )
+ xTxtImport->SetCursor( mxCursor );
+ }
+ }
+
+ // if we have a text cursor, lets try to import some text
+ if( mxCursor.is() )
+ {
+ pContext = GetImport().GetTextImport()->CreateTextChildContext( GetImport(), nPrefix, rLocalName, xAttrList );
+ }
+ }
+ }
+
+ // call parent for content
+ if(!pContext)
+ pContext = SvXMLImportContext::CreateChildContext( nPrefix, rLocalName, xAttrList );
+
+ return pContext;
+}
+
+void DrawAnnotationContext::EndElement()
+{
+ if(mxCursor.is())
+ {
+ // delete addition newline
+ const OUString aEmpty;
+ mxCursor->gotoEnd( sal_False );
+ mxCursor->goLeft( 1, sal_True );
+ mxCursor->setString( aEmpty );
+
+ // reset cursor
+ GetImport().GetTextImport()->ResetCursor();
+ }
+
+ if( mxAnnotation.is() )
+ {
+ mxAnnotation->setAuthor( maAuthorBuffer.makeStringAndClear() );
+
+ DateTime aDateTime;
+ if(SvXMLUnitConverter::convertDateTime(aDateTime, maDateBuffer.makeStringAndClear()))
+ mxAnnotation->setDateTime(aDateTime);
+ }
+}
//////////////////////////////////////////////////////////////////////////////
@@ -70,8 +220,9 @@ SdXMLGenericPageContext::SdXMLGenericPageContext(
USHORT nPrfx, const OUString& rLocalName,
const Reference< xml::sax::XAttributeList>& xAttrList,
Reference< drawing::XShapes >& rShapes)
-: SvXMLImportContext( rImport, nPrfx, rLocalName ),
- mxShapes( rShapes )
+: SvXMLImportContext( rImport, nPrfx, rLocalName )
+, mxShapes( rShapes )
+, mxAnnotationAccess( rShapes, UNO_QUERY )
{
sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
@@ -100,10 +251,8 @@ void SdXMLGenericPageContext::StartElement( const Reference< ::com::sun::star::x
{
GetImport().GetShapeImport()->pushGroupForSorting( mxShapes );
-#ifndef SVX_LIGHT
if( GetImport().IsFormsSupported() )
GetImport().GetFormImport()->startPage( Reference< drawing::XDrawPage >::query( mxShapes ) );
-#endif
}
//////////////////////////////////////////////////////////////////////////////
@@ -120,10 +269,13 @@ SvXMLImportContext* SdXMLGenericPageContext::CreateChildContext( USHORT nPrefix,
}
else if( nPrefix == XML_NAMESPACE_OFFICE && IsXMLToken( rLocalName, XML_FORMS ) )
{
-#ifndef SVX_LIGHT
if( GetImport().IsFormsSupported() )
pContext = GetImport().GetFormImport()->createOfficeFormsContext( GetImport(), nPrefix, rLocalName );
-#endif
+ }
+ else if( ((nPrefix == XML_NAMESPACE_OFFICE) || (nPrefix == XML_NAMESPACE_OFFICE_EXT)) && IsXMLToken( rLocalName, XML_ANNOTATION ) )
+ {
+ if( mxAnnotationAccess.is() )
+ pContext = new DrawAnnotationContext( GetImport(), nPrefix, rLocalName, xAttrList, mxAnnotationAccess );
}
else
{
diff --git a/xmloff/source/draw/ximppage.hxx b/xmloff/source/draw/ximppage.hxx
index fa32546b0810..45b505e2044f 100644
--- a/xmloff/source/draw/ximppage.hxx
+++ b/xmloff/source/draw/ximppage.hxx
@@ -35,6 +35,7 @@
#include "sdxmlimp_impl.hxx"
#include <xmloff/nmspmap.hxx>
#include <com/sun/star/drawing/XShapes.hpp>
+#include <com/sun/star/office/XAnnotationAccess.hpp>
#include <tools/rtti.hxx>
#include "ximpshap.hxx"
@@ -44,7 +45,8 @@
class SdXMLGenericPageContext : public SvXMLImportContext
{
// the shape group this group is working on
- com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > mxShapes;
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > mxShapes;
+ ::com::sun::star::uno::Reference< ::com::sun::star::office::XAnnotationAccess > mxAnnotationAccess;
protected:
rtl::OUString maPageLayoutName;
diff --git a/xmloff/source/meta/MetaExportComponent.cxx b/xmloff/source/meta/MetaExportComponent.cxx
index 0b65592c3613..996e75d0f740 100644
--- a/xmloff/source/meta/MetaExportComponent.cxx
+++ b/xmloff/source/meta/MetaExportComponent.cxx
@@ -170,6 +170,7 @@ sal_uInt32 XMLMetaExportComponent::exportDoc( enum XMLTokenEnum )
const sal_Char* pVersion = 0;
switch( getDefaultVersion() )
{
+ case SvtSaveOptions::ODFVER_LATEST: pVersion = "1.2"; break;
case SvtSaveOptions::ODFVER_012: pVersion = "1.2"; break;
case SvtSaveOptions::ODFVER_011: pVersion = "1.1"; break;
case SvtSaveOptions::ODFVER_010: break;