summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorDaniel Rentz <dr@openoffice.org>2010-06-21 15:39:04 +0200
committerDaniel Rentz <dr@openoffice.org>2010-06-21 15:39:04 +0200
commitb6c1b13bb24fe05a69bc4c07909a254825cdadb1 (patch)
tree2240bf90730b1f229cefd3e73aed712666aa69a2 /xmloff
parent398ded4c2c2974a119e59b387e6cdad0d66d2357 (diff)
parent99e133f3abede854db3c78e1aca60fa16ffa412b (diff)
mib16: rebase to m83
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/inc/xmlnmspe.hxx3
-rw-r--r--xmloff/inc/xmloff/shapeexport.hxx3
-rw-r--r--xmloff/inc/xmloff/xmltoken.hxx8
-rw-r--r--xmloff/qa/unoapi/knownissues.xcl11
-rw-r--r--xmloff/qa/unoapi/xmloff.sce4
-rw-r--r--xmloff/source/core/xmlexp.cxx2
-rw-r--r--xmloff/source/core/xmlimp.cxx4
-rw-r--r--xmloff/source/core/xmltoken.cxx6
-rw-r--r--xmloff/source/draw/sdxmlexp.cxx9
-rw-r--r--xmloff/source/draw/shapeexport.cxx35
-rw-r--r--xmloff/source/draw/ximpshap.cxx23
-rw-r--r--xmloff/source/draw/ximpshap.hxx3
-rw-r--r--xmloff/source/text/txtimp.cxx26
13 files changed, 115 insertions, 22 deletions
diff --git a/xmloff/inc/xmlnmspe.hxx b/xmloff/inc/xmlnmspe.hxx
index be3ba5e837..1451cdeb57 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 d6319874a3..9f28c27207 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 b80b4b2e0c..f631c5855d 100644
--- a/xmloff/inc/xmloff/xmltoken.hxx
+++ b/xmloff/inc/xmloff/xmltoken.hxx
@@ -147,7 +147,10 @@ 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 401d33d9a8..ac15aad11e 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 c73533f4e4..69166aec62 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 25965187f4..9b1ddcb088 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 e128bfc556..ba559a00e7 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 d18b7c550a..7ed6e82287 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 a0eb4b7e56..e8074759de 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 a0fb695556..76353ba6a3 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 90b098a32a..82285ba30d 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 8101b89c4d..17b7c7a420 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 4fbf91d2b0..e4a47d14fa 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;
+ }
+ }
}
}
}