diff options
author | Daniel Rentz <dr@openoffice.org> | 2010-06-21 15:39:04 +0200 |
---|---|---|
committer | Daniel Rentz <dr@openoffice.org> | 2010-06-21 15:39:04 +0200 |
commit | 217f6932839045b7a3b487524366f7163fa4c035 (patch) | |
tree | bd791daed2a5212249687053bae30ab1196c437d /xmloff | |
parent | 1a639c734cec2dfce0a4efe2fecdeeddbbc9b441 (diff) | |
parent | 34dd33af79caf3a13ec3a4e7098616ac0b16cf50 (diff) |
mib16: rebase to m83
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/inc/xmlnmspe.hxx | 3 | ||||
-rw-r--r-- | xmloff/inc/xmloff/shapeexport.hxx | 3 | ||||
-rw-r--r-- | xmloff/inc/xmloff/xmltoken.hxx | 6 | ||||
-rw-r--r-- | xmloff/qa/unoapi/knownissues.xcl | 11 | ||||
-rw-r--r-- | xmloff/qa/unoapi/xmloff.sce | 4 | ||||
-rw-r--r-- | xmloff/source/core/xmlexp.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/core/xmlimp.cxx | 4 | ||||
-rw-r--r-- | xmloff/source/core/xmltoken.cxx | 6 | ||||
-rw-r--r-- | xmloff/source/draw/sdxmlexp.cxx | 9 | ||||
-rw-r--r-- | xmloff/source/draw/shapeexport.cxx | 35 | ||||
-rw-r--r-- | xmloff/source/draw/ximpshap.cxx | 23 | ||||
-rw-r--r-- | xmloff/source/draw/ximpshap.hxx | 3 | ||||
-rw-r--r-- | xmloff/source/text/txtimp.cxx | 26 |
13 files changed, 114 insertions, 21 deletions
diff --git a/xmloff/inc/xmlnmspe.hxx b/xmloff/inc/xmlnmspe.hxx index e7891b36ef17..7b7b7e131ec7 100644 --- a/xmloff/inc/xmlnmspe.hxx +++ b/xmloff/inc/xmlnmspe.hxx @@ -88,8 +88,9 @@ const sal_uInt16 XML_NAMESPACE_##prefix##_EXT_IDX = key; XML_NAMESPACE_EXT( OFFICE, 37U ) XML_NAMESPACE_EXT( TABLE, 38U ) XML_NAMESPACE_EXT( CHART, 39U ) +XML_NAMESPACE_EXT( DRAW, 40U ) -#define _XML_OLD_NAMESPACE_BASE 40U +#define _XML_OLD_NAMESPACE_BASE 41U // namespaces used in the technical preview (SO 5.2) XML_OLD_NAMESPACE( FO, 0U ) diff --git a/xmloff/inc/xmloff/shapeexport.hxx b/xmloff/inc/xmloff/shapeexport.hxx index b12f93f0b8b2..e583a208fd83 100644 --- a/xmloff/inc/xmloff/shapeexport.hxx +++ b/xmloff/inc/xmloff/shapeexport.hxx @@ -191,6 +191,9 @@ private: SAL_DLLPRIVATE UniReference< SvXMLExportPropertyMapper > GetPropertySetMapper() const { return mxPropertySetMapper; } const rtl::OUString msZIndex; + const rtl::OUString msPrintable; + const rtl::OUString msVisible; + const rtl::OUString msEmptyPres; const rtl::OUString msModel; const rtl::OUString msStartShape; diff --git a/xmloff/inc/xmloff/xmltoken.hxx b/xmloff/inc/xmloff/xmltoken.hxx index 06b057a3e91d..19eb9a3854df 100644 --- a/xmloff/inc/xmloff/xmltoken.hxx +++ b/xmloff/inc/xmloff/xmltoken.hxx @@ -148,6 +148,9 @@ namespace xmloff { namespace token { XML_NP_TABLE_EXT, XML_N_TABLE_EXT, + XML_NP_DRAW_EXT, + XML_N_DRAW_EXT, + // units XML_UNIT_MM, XML_UNIT_M, @@ -2548,6 +2551,9 @@ namespace xmloff { namespace token { XML_DIMENSION, XML_VALIDATION_NAME, + XML_SCREEN, + XML_PRINTER, + // XForms tokens // already defined: XML_ACTION, XML_VERSION, XML_ENCODING, // XML_REPLACE, XML_SEPARATOR, XML_TYPE, XML_ID diff --git a/xmloff/qa/unoapi/knownissues.xcl b/xmloff/qa/unoapi/knownissues.xcl index 401d33d9a889..ac15aad11e71 100644 --- a/xmloff/qa/unoapi/knownissues.xcl +++ b/xmloff/qa/unoapi/knownissues.xcl @@ -10,17 +10,6 @@ xmloff.Impress.XMLImporter::com::sun::star::xml::sax::XDocumentHandler xmloff.Impress.XMLMetaImporter::com::sun::star::xml::sax::XDocumentHandler xmloff.Impress.XMLStylesImporter::com::sun::star::xml::sax::XDocumentHandler -### i86555 ### -xmloff.Chart.XMLExporter::com::sun::star::document::XFilter -xmloff.Chart.XMLContentExporter::com::sun::star::document::XFilter -xmloff.Impress.XMLSettingsExporter::com::sun::star::document::XFilter -xmloff.Impress.XMLMetaExporter::com::sun::star::document::XFilter -xmloff.Impress.XMLImporter::com::sun::star::document::XFilter -xmloff.Impress.XMLExporter::com::sun::star::document::XFilter -xmloff.Draw.XMLContentExporter::com::sun::star::document::XFilter -xmloff.Draw.XMLMetaExporter::com::sun::star::document::XFilter -xmloff.Draw.XMLSettingsImporter::com::sun::star::document::XFilter - ### i87695 ### xmloff.Draw.XMLStylesExporter xmloff.Impress.XMLStylesExporter diff --git a/xmloff/qa/unoapi/xmloff.sce b/xmloff/qa/unoapi/xmloff.sce index c73533f4e4e8..69166aec6204 100644 --- a/xmloff/qa/unoapi/xmloff.sce +++ b/xmloff/qa/unoapi/xmloff.sce @@ -3,7 +3,7 @@ #111102# -o xmloff.Chart.XMLExporter #111102# -o xmloff.Chart.XMLImporter #111102# -o xmloff.Chart.XMLStylesExporter -#111102# -o xmloff.Chart.XMLStylesImporter +#111102# #i112047 -o xmloff.Chart.XMLStylesImporter -o xmloff.Draw.XMLContentExporter -o xmloff.Draw.XMLContentImporter -o xmloff.Draw.XMLExporter @@ -16,7 +16,7 @@ -o xmloff.Draw.XMLStylesImporter #i111224 -o xmloff.Impress.XMLContentExporter -o xmloff.Impress.XMLContentImporter --o xmloff.Impress.XMLExporter +#i112048 -o xmloff.Impress.XMLExporter #i111111# -o xmloff.Impress.XMLImporter -o xmloff.Impress.XMLMetaExporter -o xmloff.Impress.XMLMetaImporter diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index c10ac0a23c03..b1ba8520c1db 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -387,7 +387,7 @@ void SvXMLExport::_InitCtor() mpNamespaceMap->Add( GetXMLToken(XML_NP_OOOC), GetXMLToken(XML_N_OOOC), XML_NAMESPACE_OOOC ); mpNamespaceMap->Add( GetXMLToken(XML_NP_OF), GetXMLToken(XML_N_OF), XML_NAMESPACE_OF ); - if (getDefaultVersion() == SvtSaveOptions::ODFVER_LATEST) + if (getDefaultVersion() > SvtSaveOptions::ODFVER_012) { mpNamespaceMap->Add( GetXMLToken(XML_NP_TABLE_EXT), GetXMLToken(XML_N_TABLE_EXT), XML_NAMESPACE_TABLE_EXT); diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 597a1d50b0f9..c791fe4077d4 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -99,6 +99,7 @@ sal_Char __READONLY_DATA sXML_np__text[] = "_text"; sal_Char __READONLY_DATA sXML_np__table[] = "_table"; sal_Char __READONLY_DATA sXML_np__table_ext[] = "_table_ooo"; sal_Char __READONLY_DATA sXML_np__draw[] = "_draw"; +sal_Char __READONLY_DATA sXML_np__draw_ext[] = "_draw_ooo"; sal_Char __READONLY_DATA sXML_np__dr3d[] = "_dr3d"; sal_Char __READONLY_DATA sXML_np__fo[] = "_fo"; sal_Char __READONLY_DATA sXML_np__xlink[] = "_xlink"; @@ -263,6 +264,9 @@ void SvXMLImport::_InitCtor() mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__draw ) ), GetXMLToken(XML_N_DRAW), XML_NAMESPACE_DRAW ); + mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__draw_ext ) ), + GetXMLToken(XML_N_DRAW_EXT), + XML_NAMESPACE_DRAW_EXT ); mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM (sXML_np__dr3d ) ), GetXMLToken(XML_N_DR3D), XML_NAMESPACE_DR3D ); diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx index 2af9966bc351..83735b77d02c 100644 --- a/xmloff/source/core/xmltoken.cxx +++ b/xmloff/source/core/xmltoken.cxx @@ -156,6 +156,9 @@ namespace xmloff { namespace token { TOKEN( "tableooo", XML_NP_TABLE_EXT ), TOKEN( "http://openoffice.org/2009/table", XML_N_TABLE_EXT ), + TOKEN( "drawooo", XML_NP_DRAW_EXT ), + TOKEN( "http://openoffice.org/2010/draw", XML_N_DRAW_EXT ), + // units TOKEN( "mm", XML_UNIT_MM ), TOKEN( "m", XML_UNIT_M ), @@ -2552,6 +2555,9 @@ namespace xmloff { namespace token { TOKEN( "dimension", XML_DIMENSION ), TOKEN( "validation-name", XML_VALIDATION_NAME ), + TOKEN( "screen", XML_SCREEN ), + TOKEN( "printer", XML_PRINTER ), + // XForms token TOKEN( "model", XML_MODEL ), TOKEN( "schema", XML_SCHEMA ), diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx index 249ce18331d9..862326495a70 100644 --- a/xmloff/source/draw/sdxmlexp.cxx +++ b/xmloff/source/draw/sdxmlexp.cxx @@ -641,12 +641,17 @@ void SAL_CALL SdXMLExport::setSourceDocument( const Reference< lang::XComponent GetXMLToken(XML_N_ANIMATION), XML_NAMESPACE_ANIMATION); - if( getDefaultVersion() == SvtSaveOptions::ODFVER_LATEST ) + if( getDefaultVersion() > SvtSaveOptions::ODFVER_012 ) { _GetNamespaceMap().Add( GetXMLToken(XML_NP_OFFICE_EXT), GetXMLToken(XML_N_OFFICE_EXT), XML_NAMESPACE_OFFICE_EXT); + + _GetNamespaceMap().Add( + GetXMLToken(XML_NP_DRAW_EXT), + GetXMLToken(XML_N_DRAW_EXT), + XML_NAMESPACE_DRAW_EXT); } GetShapeExport()->enableLayerExport(); @@ -2808,7 +2813,7 @@ void SdXMLExport::collectAnnotationAutoStyles( const Reference<XDrawPage>& xDraw void SdXMLExport::exportAnnotations( const Reference<XDrawPage>& xDrawPage ) { // do not export in ODF 1.2 or older - if( getDefaultVersion() != SvtSaveOptions::ODFVER_LATEST ) + if( getDefaultVersion() <= SvtSaveOptions::ODFVER_012 ) return; Reference< XAnnotationAccess > xAnnotationAccess( xDrawPage, UNO_QUERY ); diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 20c7879416cf..d3dd99967ae9 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -83,6 +83,8 @@ XMLShapeExport::XMLShapeExport(SvXMLExport& rExp, // #88546# init to FALSE mbHandleProgressBar( sal_False ), msZIndex( RTL_CONSTASCII_USTRINGPARAM("ZOrder") ), + msPrintable( RTL_CONSTASCII_USTRINGPARAM("Printable") ), + msVisible( RTL_CONSTASCII_USTRINGPARAM("Visible") ), msEmptyPres( RTL_CONSTASCII_USTRINGPARAM("IsEmptyPresentationObject") ), msModel( RTL_CONSTASCII_USTRINGPARAM("Model") ), msStartShape( RTL_CONSTASCII_USTRINGPARAM("StartShape") ), @@ -705,6 +707,39 @@ void XMLShapeExport::exportShape(const uno::Reference< drawing::XShape >& xShape } } + // export draw:display (do not export in ODF 1.2 or older) + if( xSet.is() && ( mrExport.getDefaultVersion() > SvtSaveOptions::ODFVER_012 ) ) + { + if( aShapeInfo.meShapeType != XmlShapeTypeDrawPageShape && aShapeInfo.meShapeType != XmlShapeTypePresPageShape && + aShapeInfo.meShapeType != XmlShapeTypeHandoutShape ) + + try + { + sal_Bool bVisible = sal_True; + sal_Bool bPrintable = sal_True; + + xSet->getPropertyValue(msVisible) >>= bVisible; + xSet->getPropertyValue(msPrintable) >>= bPrintable; + + XMLTokenEnum eDisplayToken = XML_TOKEN_INVALID; + const unsigned short nDisplay = (bVisible ? 2 : 0) | (bPrintable ? 1 : 0); + switch( nDisplay ) + { + case 0: eDisplayToken = XML_NONE; break; + case 1: eDisplayToken = XML_PRINTER; break; + case 2: eDisplayToken = XML_SCREEN; break; + // case 3: eDisplayToken = XML_ALWAYS break; this is the default + } + + if( eDisplayToken != XML_TOKEN_INVALID ) + mrExport.AddAttribute(XML_NAMESPACE_DRAW_EXT, XML_DISPLAY, eDisplayToken ); + } + catch( uno::Exception& ) + { + DBG_ERROR( "XMLShapeExport::exportShape(), exception caught!" ); + } + } + // #82003# test export count // #91587# ALWAYS increment since now ALL to be exported shapes are counted. if(mrExport.GetShapeExport()->IsHandleProgressBarEnabled()) diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index f1bf683b57e9..b073e1e28d40 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -167,6 +167,8 @@ SdXMLShapeContext::SdXMLShapeContext( , mnZOrder(-1) , maSize(1, 1) , maPosition(0, 0) +, mbVisible(true) +, mbPrintable(true) { } @@ -444,6 +446,20 @@ void SdXMLShapeContext::AddShape(uno::Reference< drawing::XShape >& xShape) xMultiPropertyStates->setAllPropertiesToDefault(); } + if( !mbVisible || !mbPrintable ) try + { + uno::Reference< beans::XPropertySet > xSet( xShape, uno::UNO_QUERY_THROW ); + if( !mbVisible ) + xSet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Visible" ) ), uno::Any( sal_False ) ); + + if( !mbPrintable ) + xSet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Printable" ) ), uno::Any( sal_False ) ); + } + catch( Exception& ) + { + DBG_ERROR( "SdXMLShapeContext::AddShape(), exception caught!" ); + } + // #107848# if(!mbTemporaryShape && (!GetImport().HasTextImport() || !GetImport().GetTextImport()->IsInsideDeleteContext())) @@ -777,7 +793,7 @@ void SdXMLShapeContext::SetThumbnail() void SdXMLShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue ) { bool bHaveXmlId( false ); - if( XML_NAMESPACE_DRAW == nPrefix ) + if( (XML_NAMESPACE_DRAW == nPrefix) || (XML_NAMESPACE_DRAW_EXT == nPrefix) ) { if( IsXMLToken( rLocalName, XML_ZINDEX ) ) { @@ -807,6 +823,11 @@ void SdXMLShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl::OUStr { mnTransform.SetString(rValue, GetImport().GetMM100UnitConverter()); } + else if( IsXMLToken( rLocalName, XML_DISPLAY ) ) + { + mbVisible = IsXMLToken( rValue, XML_ALWAYS ) || IsXMLToken( rValue, XML_SCREEN ); + mbPrintable = IsXMLToken( rValue, XML_ALWAYS ) || IsXMLToken( rValue, XML_PRINTER ); + } } else if( XML_NAMESPACE_PRESENTATION == nPrefix ) { diff --git a/xmloff/source/draw/ximpshap.hxx b/xmloff/source/draw/ximpshap.hxx index 18453a8936af..bf15534fc260 100644 --- a/xmloff/source/draw/ximpshap.hxx +++ b/xmloff/source/draw/ximpshap.hxx @@ -83,6 +83,9 @@ protected: com::sun::star::awt::Size maSize; com::sun::star::awt::Point maPosition; + bool mbVisible; + bool mbPrintable; + /** if bSupportsStyle is false, auto styles will be set but not a style */ void SetStyle( bool bSupportsStyle = true ); void SetLayer(); diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx index bc01112d9b03..87710d310d76 100644 --- a/xmloff/source/text/txtimp.cxx +++ b/xmloff/source/text/txtimp.cxx @@ -119,7 +119,7 @@ using namespace ::com::sun::star::lang; using namespace ::xmloff::token; using ::com::sun::star::util::DateTime; using namespace ::com::sun::star::ucb; - +using namespace ::com::sun::star; using ::comphelper::UStringLess; @@ -1823,8 +1823,28 @@ OUString XMLTextImportHelper::SetStyleAndAttrs( Reference<XTextContent> xTextContent(xTmp, UNO_QUERY); if (m_pImpl->m_xText.is() && xRange.is()) { - m_pImpl->m_xText->insertTextContent( - xRange, xTextContent, sal_True); + // #i107225# the combined characters need to be inserted first + // the selected text has to be removed afterwards + m_pImpl->m_xText->insertTextContent( xRange->getStart(), xTextContent, sal_True ); + + if( xRange->getString().getLength() ) + { + try + { + uno::Reference< text::XTextCursor > xCrsr = xRange->getText()->createTextCursorByRange( xRange->getStart() ); + xCrsr->goLeft( 1, true ); + uno::Reference< beans::XPropertySet> xCrsrProperties( xCrsr, uno::UNO_QUERY_THROW ); + //the hard properties of the removed text need to be applied to the combined characters field + pStyle->FillPropertySet( xCrsrProperties ); + xCrsr->collapseToEnd(); + xCrsr->gotoRange( xRange->getEnd(), true ); + xCrsr->setString( ::rtl::OUString() ); + } + catch( const uno::Exception& rEx ) + { + (void)rEx; + } + } } } } |