diff options
author | Ingrid Halama <iha@openoffice.org> | 2010-05-05 18:16:33 +0200 |
---|---|---|
committer | Ingrid Halama <iha@openoffice.org> | 2010-05-05 18:16:33 +0200 |
commit | e5fca8fd92fed0b7b719645c461ffe89401ff62a (patch) | |
tree | 57a8114f79c76760ff21d0a3059ab7bf2d00a14b /xmloff | |
parent | 838c91c229efff4a846fb8d6efd0211b999adf56 (diff) |
chartpositioning: #i100778# simplify user interface: reduce sizing options to new excluding mode only
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/inc/xmloff/xmltoken.hxx | 1 | ||||
-rw-r--r-- | xmloff/source/chart/SchXMLExport.cxx | 16 | ||||
-rw-r--r-- | xmloff/source/chart/SchXMLPlotAreaContext.cxx | 35 | ||||
-rw-r--r-- | xmloff/source/chart/SchXMLPlotAreaContext.hxx | 6 | ||||
-rw-r--r-- | xmloff/source/core/xmltoken.cxx | 1 |
5 files changed, 21 insertions, 38 deletions
diff --git a/xmloff/inc/xmloff/xmltoken.hxx b/xmloff/inc/xmloff/xmltoken.hxx index 60e8d054ac8e..06b057a3e91d 100644 --- a/xmloff/inc/xmloff/xmltoken.hxx +++ b/xmloff/inc/xmloff/xmltoken.hxx @@ -3099,7 +3099,6 @@ namespace xmloff { namespace token { XML_NP_CHART_EXT, XML_N_CHART_EXT, XML_COORDINATE_REGION, - XML_PREFER_COORDINATE_REGION, XML_TOKEN_END }; diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index 9f0653cd44d9..03ef351b2047 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -199,7 +199,7 @@ public: const ::com::sun::star::awt::Size & rPageSize, sal_Bool bExportContent, sal_Bool bIncludeTable ); - void exportExcludingPosition( const com::sun::star::uno::Reference< com::sun::star::chart::XDiagram >& xDiagram ); + void exportCoordinateRegion( const com::sun::star::uno::Reference< com::sun::star::chart::XDiagram >& xDiagram ); void exportAxes( const com::sun::star::uno::Reference< com::sun::star::chart::XDiagram > & xDiagram, const com::sun::star::uno::Reference< com::sun::star::chart2::XDiagram > & xNewDiagram, sal_Bool bExportContent ); @@ -1921,7 +1921,7 @@ void SchXMLExportHelper_Impl::exportPlotArea( pElPlotArea = new SvXMLElementExport( mrExport, XML_NAMESPACE_CHART, XML_PLOT_AREA, sal_True, sal_True ); //inner position rectangle element - exportExcludingPosition( xDiagram ); + exportCoordinateRegion( xDiagram ); // light sources (inside plot area element) if( bIs3DChart && @@ -2083,12 +2083,12 @@ void SchXMLExportHelper_Impl::exportPlotArea( delete pElPlotArea; } -void SchXMLExportHelper_Impl::exportExcludingPosition( const uno::Reference< chart::XDiagram >& xDiagram ) +void SchXMLExportHelper_Impl::exportCoordinateRegion( const uno::Reference< chart::XDiagram >& xDiagram ) { const SvtSaveOptions::ODFDefaultVersion nCurrentODFVersion( SvtSaveOptions().GetODFDefaultVersion() ); if( nCurrentODFVersion <= SvtSaveOptions::ODFVER_012 )//do not export to ODF 1.2 or older return; - if( nCurrentODFVersion != SvtSaveOptions::ODFVER_LATEST )//export only if extensions are enabled //todo: change this dependent on fileformat evolution + if( nCurrentODFVersion != SvtSaveOptions::ODFVER_LATEST )//export only if extensions are enabled //#i100778# todo: change this dependent on fileformat evolution return; Reference< chart::XDiagramPositioning > xDiaPos( xDiagram, uno::UNO_QUERY ); @@ -2100,13 +2100,7 @@ void SchXMLExportHelper_Impl::exportExcludingPosition( const uno::Reference< cha addPosition( awt::Point(aRect.X,aRect.Y) ); addSize( awt::Size(aRect.Width,aRect.Height) ); - sal_Bool bPreferExcludingPositioning = xDiaPos->isExcludingDiagramPositioning(); - rtl::OUStringBuffer sStringBuffer; - SvXMLUnitConverter::convertBool( sStringBuffer, bPreferExcludingPositioning ); - String aString( sStringBuffer.makeStringAndClear() ); - mrExport.AddAttribute( XML_NAMESPACE_CHART_EXT, XML_PREFER_COORDINATE_REGION, aString );//todo: change to chart namespace in future - dependent on fileformat - - SvXMLElementExport aExcludingPosition( mrExport, XML_NAMESPACE_CHART_EXT, XML_COORDINATE_REGION, sal_True, sal_True );//todo: change to chart namespace in future - dependent on fileformat + SvXMLElementExport aCoordinateRegion( mrExport, XML_NAMESPACE_CHART_EXT, XML_COORDINATE_REGION, sal_True, sal_True );//#i100778# todo: change to chart namespace in future - dependent on fileformat } void SchXMLExportHelper_Impl::exportAxes( diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx index 75fc4b2b5cdb..011e9228612e 100644 --- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx +++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx @@ -523,7 +523,7 @@ SvXMLImportContext* SchXMLPlotAreaContext::CreateChildContext( case XML_TOK_PA_COORDINATE_REGION_EXT: case XML_TOK_PA_COORDINATE_REGION: { - pContext = new SchXMLExcludingPositionContext( GetImport(), nPrefix, rLocalName, m_aInnerPositioning ); + pContext = new SchXMLCoordinateRegionContext( GetImport(), nPrefix, rLocalName, m_aInnerPositioning ); } break; @@ -694,20 +694,17 @@ void SchXMLPlotAreaContext::EndElement() uno::Reference< chart::XDiagramPositioning > xDiaPos( mxDiagram, uno::UNO_QUERY ); if( xDiaPos.is()) { - bool bOuterSize = m_aOuterPositioning.hasPosSize() && !m_aOuterPositioning.isAutomatic(); - if( m_aInnerPositioning.hasPosSize() ) + if( !m_aOuterPositioning.isAutomatic() ) { - if( !m_aInnerPositioning.isAutomatic() ) + if( m_aInnerPositioning.hasPosSize() ) xDiaPos->setDiagramPositionExcludingAxes( m_aInnerPositioning.getRectangle() ); - else if( bOuterSize ) - xDiaPos->setDiagramPositionIncludingAxes( m_aOuterPositioning.getRectangle() ); - } - else if( bOuterSize ) - { - if( SchXMLTools::isDocumentGeneratedWithOpenOfficeOlderThan3_3( GetImport().GetModel() ) ) //old version of OOo did write a wrong rectangle for the diagram size - xDiaPos->setDiagramPositionIncludingAxesAndAxisTitles( m_aOuterPositioning.getRectangle() ); - else - xDiaPos->setDiagramPositionIncludingAxes( m_aOuterPositioning.getRectangle() ); + else if( m_aOuterPositioning.hasPosSize() ) + { + if( SchXMLTools::isDocumentGeneratedWithOpenOfficeOlderThan3_3( GetImport().GetModel() ) ) //old version of OOo did write a wrong rectangle for the diagram size + xDiaPos->setDiagramPositionIncludingAxesAndAxisTitles( m_aOuterPositioning.getRectangle() ); + else + xDiaPos->setDiagramPositionIncludingAxes( m_aOuterPositioning.getRectangle() ); + } } } @@ -1744,12 +1741,6 @@ bool SchXMLPositonAttributesHelper::readPositioningAttribute( sal_uInt16 nPrefix else bReturn = false; } - else if( IsXMLToken( rLocalName, XML_PREFER_COORDINATE_REGION ) ) - { - sal_Bool bPreferExcludingPosition = false; - m_rImport.GetMM100UnitConverter().convertBool( bPreferExcludingPosition, rValue ); - m_bAutoPosition = m_bAutoSize = !bPreferExcludingPosition; - } else bReturn = false; @@ -1771,7 +1762,7 @@ void SchXMLPositonAttributesHelper::readAutomaticPositioningProperties( XMLPropS // ======================================== -SchXMLExcludingPositionContext::SchXMLExcludingPositionContext( +SchXMLCoordinateRegionContext::SchXMLCoordinateRegionContext( SvXMLImport& rImport , sal_uInt16 nPrefix , const rtl::OUString& rLocalName @@ -1781,11 +1772,11 @@ SchXMLExcludingPositionContext::SchXMLExcludingPositionContext( { } -SchXMLExcludingPositionContext::~SchXMLExcludingPositionContext() +SchXMLCoordinateRegionContext::~SchXMLCoordinateRegionContext() { } -void SchXMLExcludingPositionContext::StartElement( const uno::Reference< xml::sax::XAttributeList >& xAttrList ) +void SchXMLCoordinateRegionContext::StartElement( const uno::Reference< xml::sax::XAttributeList >& xAttrList ) { // parse attributes sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0; diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.hxx b/xmloff/source/chart/SchXMLPlotAreaContext.hxx index cb986d7e7a3d..1f0de466dcb1 100644 --- a/xmloff/source/chart/SchXMLPlotAreaContext.hxx +++ b/xmloff/source/chart/SchXMLPlotAreaContext.hxx @@ -251,15 +251,15 @@ public: // ---------------------------------------- -class SchXMLExcludingPositionContext : public SvXMLImportContext +class SchXMLCoordinateRegionContext : public SvXMLImportContext { public: - SchXMLExcludingPositionContext( + SchXMLCoordinateRegionContext( SvXMLImport& rImport , sal_uInt16 nPrefix , const rtl::OUString& rLocalName , SchXMLPositonAttributesHelper& rPositioning ); - virtual ~SchXMLExcludingPositionContext(); + virtual ~SchXMLCoordinateRegionContext(); virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); private: diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx index 2ee9176bb080..2af9966bc351 100644 --- a/xmloff/source/core/xmltoken.cxx +++ b/xmloff/source/core/xmltoken.cxx @@ -3099,7 +3099,6 @@ namespace xmloff { namespace token { TOKEN( "chartooo", XML_NP_CHART_EXT ), TOKEN( "http://openoffice.org/2010/chart", XML_N_CHART_EXT ), TOKEN( "coordinate-region", XML_COORDINATE_REGION ), - TOKEN( "prefer-coordinate-region", XML_PREFER_COORDINATE_REGION ), #if OSL_DEBUG_LEVEL > 0 { 0, NULL, NULL, XML_TOKEN_END } |