From ec712408961a4a2efc667a7af83a21209907f9eb Mon Sep 17 00:00:00 2001 From: Ingrid Halama Date: Fri, 20 Nov 2009 11:58:22 +0100 Subject: chartpositioning: #i100778# chart positioning excluding labels --- xmloff/source/chart/SchXMLExport.cxx | 351 ++++++++++++++++++++------ xmloff/source/chart/SchXMLImport.cxx | 1 + xmloff/source/chart/SchXMLPlotAreaContext.cxx | 194 +++++++++++--- xmloff/source/chart/SchXMLPlotAreaContext.hxx | 59 ++++- xmloff/source/core/xmltoken.cxx | 3 + xmloff/source/draw/shapeexport2.cxx | 22 -- 6 files changed, 488 insertions(+), 142 deletions(-) (limited to 'xmloff/source') diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index f7cf82abe974..5232c757ccb7 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -81,6 +81,7 @@ #include #include #include +#include #include #include @@ -120,6 +121,162 @@ using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Any; +// ======================================== +// class SchXMLExportHelper_Impl +// ======================================== + +class SchXMLExportHelper_Impl +{ +public: + // first: data sequence for label, second: data sequence for values. + typedef ::std::pair< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence >, + ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence > > tLabelValuesDataPair; + typedef ::std::vector< tLabelValuesDataPair > tDataSequenceCont; + +public: + SchXMLExportHelper_Impl( SvXMLExport& rExport, + SvXMLAutoStylePoolP& rASPool ); + + virtual ~SchXMLExportHelper_Impl(); + + // auto-styles + /// parse chart and collect all auto-styles used in current pool + void collectAutoStyles( com::sun::star::uno::Reference< + com::sun::star::chart::XChartDocument > rChartDoc ); + + /// write the styles collected into the current pool as elements + void exportAutoStyles(); + + /** export the element corresponding to rChartDoc + if bIncludeTable is true, the chart data is exported as + element (inside the chart element). + + Otherwise the external references stored in the chart document are used + for writing the corresponding attributes at series + + All attributes contained in xAttrList are written at the chart element, + which ist the outer element of a chart. So these attributes can easily + be parsed again by the container + */ + void exportChart( com::sun::star::uno::Reference< + com::sun::star::chart::XChartDocument > rChartDoc, + sal_Bool bIncludeTable ); + + UniReference< XMLPropertySetMapper > GetPropertySetMapper() const; + + void SetChartRangeAddress( const ::rtl::OUString& rAddress ) + { msChartAddress = rAddress; } + void SetTableNumberList( const ::rtl::OUString& rList ) + { msTableNumberList = rList; } + + void InitRangeSegmentationProperties( + const ::com::sun::star::uno::Reference< + ::com::sun::star::chart2::XChartDocument > & xChartDoc ); + + ::com::sun::star::awt::Size getPageSize( + const ::com::sun::star::uno::Reference< + ::com::sun::star::chart2::XChartDocument > & xChartDoc ) const; + + /** first parseDocument: collect autostyles and store names in this queue + second parseDocument: export content and use names from this queue + */ + ::std::queue< ::rtl::OUString > maAutoStyleNameQueue; + void CollectAutoStyle( + const std::vector< XMLPropertyState >& aStates ); + void AddAutoStyleAttribute( + const std::vector< XMLPropertyState >& aStates ); + + SvXMLAutoStylePoolP& GetAutoStylePoolP() + { return mrAutoStylePool; } + + /// if bExportContent is false the auto-styles are collected + void parseDocument( com::sun::star::uno::Reference< + com::sun::star::chart::XChartDocument >& rChartDoc, + sal_Bool bExportContent, + sal_Bool bIncludeTable = sal_False ); + void exportTable(); + void exportPlotArea( + com::sun::star::uno::Reference< com::sun::star::chart::XDiagram > xDiagram, + com::sun::star::uno::Reference< com::sun::star::chart2::XDiagram > xNewDiagram, + 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 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 ); + + void exportSeries( + const com::sun::star::uno::Reference< com::sun::star::chart2::XDiagram > & xNewDiagram, + const ::com::sun::star::awt::Size & rPageSize, + sal_Bool bExportContent, + sal_Bool bHasTwoYAxes ); + void exportCandleStickSeries( + const ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Reference< + ::com::sun::star::chart2::XDataSeries > > & aSeriesSeq, + const ::com::sun::star::uno::Reference< + ::com::sun::star::chart2::XDiagram > & xDiagram, + sal_Bool bJapaneseCandleSticks, + sal_Bool bExportContent ); + void exportDataPoints( + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > & xSeriesProperties, + sal_Int32 nSeriesLength, + const ::com::sun::star::uno::Reference< + ::com::sun::star::chart2::XDiagram > & xDiagram, + sal_Bool bExportContent ); + void exportRegressionCurve( + const ::com::sun::star::uno::Reference< + ::com::sun::star::chart2::XDataSeries > & xSeries, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > & xSeriesProp, + const ::com::sun::star::awt::Size & rPageSize, + sal_Bool bExportContent ); + + /// add svg position as attribute for current element + void addPosition( const ::com::sun::star::awt::Point & rPosition ); + void addPosition( com::sun::star::uno::Reference< com::sun::star::drawing::XShape > xShape ); + /// add svg size as attribute for current element + void addSize( const ::com::sun::star::awt::Size & rSize ); + void addSize( com::sun::star::uno::Reference< com::sun::star::drawing::XShape > xShape ); + /// fills the member msString with the appropriate String (i.e. "A3") + void getCellAddress( sal_Int32 nCol, sal_Int32 nRow ); + /// interchanges rows and columns of the sequence given + void swapDataArray( com::sun::star::uno::Sequence< com::sun::star::uno::Sequence< double > >& rSequence ); + /// exports a string as a paragraph element + void exportText( const ::rtl::OUString& rText, bool bConvertTabsLFs = false ); + void exportErrorBarRanges(); + + SchXMLExportHelper_Impl(SchXMLExportHelper_Impl &); // not defined + void operator =(SchXMLExportHelper_Impl &); // not defined + +public: + SvXMLExport& mrExport; + SvXMLAutoStylePoolP& mrAutoStylePool; + UniReference< XMLPropertyHandlerFactory > mxPropertyHandlerFactory; + UniReference< XMLPropertySetMapper > mxPropertySetMapper; + UniReference< XMLChartExportPropertyMapper > mxExpPropMapper; + + rtl::OUString msTableName; + rtl::OUStringBuffer msStringBuffer; + rtl::OUString msString; + + // members filled by InitRangeSegmentationProperties (retrieved from DataProvider) + sal_Bool mbHasSeriesLabels; + sal_Bool mbHasCategoryLabels; //if the categories are only automatically generated this will be false + sal_Bool mbRowSourceColumns; + rtl::OUString msChartAddress; + rtl::OUString msTableNumberList; + ::com::sun::star::uno::Sequence< sal_Int32 > maSequenceMapping; + + rtl::OUString msCLSID; + + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > mxAdditionalShapes; + + tDataSequenceCont m_aDataSequencesToExport; +}; + namespace { Reference< uno::XComponentContext > lcl_getComponentContext() @@ -369,7 +526,7 @@ tLabelAndValueRange lcl_getLabelAndValueRangeByRole( const Sequence< Reference< chart2::data::XLabeledDataSequence > > & aSeqCnt, const OUString & rRole, const Reference< chart2::XChartDocument > & xDoc, - SchXMLExportHelper::tDataSequenceCont & rOutSequencesToExport ) + SchXMLExportHelper_Impl::tDataSequenceCont & rOutSequencesToExport ) { tLabelAndValueRange aResult; @@ -386,7 +543,7 @@ tLabelAndValueRange lcl_getLabelAndValueRangeByRole( aResult.second = lcl_ConvertRange( xValueSeq->getSourceRangeRepresentation(), xDoc ); if( xLabelSeq.is() || xValueSeq.is()) - rOutSequencesToExport.push_back( SchXMLExportHelper::tLabelValuesDataPair( xLabelSeq, xValueSeq )); + rOutSequencesToExport.push_back( SchXMLExportHelper_Impl::tLabelValuesDataPair( xLabelSeq, xValueSeq )); } return aResult; @@ -468,10 +625,10 @@ OUString lcl_getLabelString( const Reference< chart2::data::XDataSequence > & xL } sal_Int32 lcl_getMaxSequenceLength( - const SchXMLExportHelper::tDataSequenceCont & rContainer ) + const SchXMLExportHelper_Impl::tDataSequenceCont & rContainer ) { sal_Int32 nResult = 0; - for( SchXMLExportHelper::tDataSequenceCont::const_iterator aIt( rContainer.begin()); + for( SchXMLExportHelper_Impl::tDataSequenceCont::const_iterator aIt( rContainer.begin()); aIt != rContainer.end(); ++aIt ) { if( aIt->first.is()) @@ -610,7 +767,7 @@ template< class T > }; -typedef ::std::map< sal_Int32, SchXMLExportHelper::tLabelValuesDataPair > +typedef ::std::map< sal_Int32, SchXMLExportHelper_Impl::tLabelValuesDataPair > lcl_DataSequenceMap; struct lcl_SequenceToMapElement : @@ -642,7 +799,7 @@ private: }; void lcl_PrepareInternalSequencesForTableExport( - SchXMLExportHelper::tDataSequenceCont & rInOutSequences, bool bHasCategories ) + SchXMLExportHelper_Impl::tDataSequenceCont & rInOutSequences, bool bHasCategories ) { lcl_DataSequenceMap aIndexSequenceMap; const sal_Int32 nOffset = bHasCategories ? 1 : 0; @@ -660,7 +817,7 @@ void lcl_PrepareInternalSequencesForTableExport( // fill empty columns for( ; nIndex < aIt->first; ++nIndex ) rInOutSequences.push_back( - SchXMLExportHelper::tDataSequenceCont::value_type( 0, 0 )); + SchXMLExportHelper_Impl::tDataSequenceCont::value_type( 0, 0 )); OSL_ASSERT( nIndex == aIt->first ); rInOutSequences.push_back( aIt->second ); } @@ -668,21 +825,21 @@ void lcl_PrepareInternalSequencesForTableExport( lcl_TableData lcl_getDataForLocalTable( - const SchXMLExportHelper::tDataSequenceCont & aPassedSequences, bool bHasCategoryLabels, + const SchXMLExportHelper_Impl::tDataSequenceCont & aPassedSequences, bool bHasCategoryLabels, bool bSwap, bool bHasOwnData, const Reference< chart2::data::XRangeXMLConversion > & xRangeConversion ) { lcl_TableData aResult; - SchXMLExportHelper::tDataSequenceCont aSequencesToExport( aPassedSequences ); + SchXMLExportHelper_Impl::tDataSequenceCont aSequencesToExport( aPassedSequences ); if( bHasOwnData ) lcl_PrepareInternalSequencesForTableExport( aSequencesToExport, bHasCategoryLabels ); - SchXMLExportHelper::tDataSequenceCont::size_type nNumSequences = aSequencesToExport.size(); - SchXMLExportHelper::tDataSequenceCont::const_iterator aBegin( aSequencesToExport.begin()); - SchXMLExportHelper::tDataSequenceCont::const_iterator aEnd( aSequencesToExport.end()); - SchXMLExportHelper::tDataSequenceCont::const_iterator aIt( aBegin ); + SchXMLExportHelper_Impl::tDataSequenceCont::size_type nNumSequences = aSequencesToExport.size(); + SchXMLExportHelper_Impl::tDataSequenceCont::const_iterator aBegin( aSequencesToExport.begin()); + SchXMLExportHelper_Impl::tDataSequenceCont::const_iterator aEnd( aSequencesToExport.end()); + SchXMLExportHelper_Impl::tDataSequenceCont::const_iterator aIt( aBegin ); if( bHasCategoryLabels ) { @@ -876,7 +1033,53 @@ struct SchXMLDataPointStruct // class SchXMLExportHelper // ======================================== -SchXMLExportHelper::SchXMLExportHelper( +SchXMLExportHelper::SchXMLExportHelper( SvXMLExport& rExport, SvXMLAutoStylePoolP& rASPool ) + : m_pImpl( new SchXMLExportHelper_Impl( rExport, rASPool ) ) +{ +} + +SchXMLExportHelper::~SchXMLExportHelper() +{ + delete m_pImpl; +} + +const OUString& SchXMLExportHelper::getChartCLSID() +{ + return m_pImpl->msCLSID; +} + +UniReference< XMLPropertySetMapper > SchXMLExportHelper_Impl::GetPropertySetMapper() const +{ + return mxPropertySetMapper; +} + +void SchXMLExportHelper_Impl::exportAutoStyles() +{ + if( mxExpPropMapper.is()) + { + //ToDo: when embedded in calc/writer this is not necessary because the + // numberformatter is shared between both documents + mrExport.exportAutoDataStyles(); + + // export chart auto styles + mrAutoStylePool.exportXML( + XML_STYLE_FAMILY_SCH_CHART_ID + , mrExport.GetDocHandler(), + mrExport.GetMM100UnitConverter(), + mrExport.GetNamespaceMap() + ); + + // export auto styles for additional shapes + mrExport.GetShapeExport()->exportAutoStyles(); + // and for text in additional shapes + mrExport.GetTextParagraphExport()->exportTextAutoStyles(); + } +} + +// private methods +// --------------- + +SchXMLExportHelper_Impl::SchXMLExportHelper_Impl( SvXMLExport& rExport, SvXMLAutoStylePoolP& rASPool ) : mrExport( rExport ), @@ -945,56 +1148,22 @@ SchXMLExportHelper::SchXMLExportHelper( String( 'T' )); } -SchXMLExportHelper::~SchXMLExportHelper() {} - -const OUString& SchXMLExportHelper::getChartCLSID() +SchXMLExportHelper_Impl::~SchXMLExportHelper_Impl() { - return msCLSID; } -void SchXMLExportHelper::exportAutoStyles() +void SchXMLExportHelper_Impl::collectAutoStyles( Reference< chart::XChartDocument > rChartDoc ) { - if( mxExpPropMapper.is()) - { - //ToDo: when embedded in calc/writer this is not necessary because the - // numberformatter is shared between both documents - mrExport.exportAutoDataStyles(); - - // export chart auto styles - mrAutoStylePool.exportXML( - XML_STYLE_FAMILY_SCH_CHART_ID - , mrExport.GetDocHandler(), - mrExport.GetMM100UnitConverter(), - mrExport.GetNamespaceMap() - ); - - // export auto styles for additional shapes - mrExport.GetShapeExport()->exportAutoStyles(); - // and for text in additional shapes - mrExport.GetTextParagraphExport()->exportTextAutoStyles(); - } -} - -void SchXMLExportHelper::collectAutoStyles( Reference< chart::XChartDocument > rChartDoc ) -{ - RTL_LOGFILE_CONTEXT_AUTHOR( aLogContext, "xmloff", "bm", "::SchXMLExportHelper::collectAutoStyles" ); - parseDocument( rChartDoc, sal_False ); } -void SchXMLExportHelper::exportChart( Reference< chart::XChartDocument > rChartDoc, +void SchXMLExportHelper_Impl::exportChart( Reference< chart::XChartDocument > rChartDoc, sal_Bool bIncludeTable ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogContext, "xmloff", "bm", "::SchXMLExportHelper::exportChart" ); - parseDocument( rChartDoc, sal_True, bIncludeTable ); DBG_ASSERT( maAutoStyleNameQueue.empty(), "There are still remaining autostyle names in the queue" ); } - -// private methods -// --------------- - ::rtl::OUString lcl_GetStringFromNumberSequence( const ::com::sun::star::uno::Sequence< sal_Int32 >& rSequenceMapping, bool bRemoveOneFromEachIndex /*should be true if having categories*/ ) { const sal_Int32* pArray = rSequenceMapping.getConstArray(); @@ -1019,7 +1188,7 @@ void SchXMLExportHelper::exportChart( Reference< chart::XChartDocument > rChartD } /// if bExportContent is false the auto-styles are collected -void SchXMLExportHelper::parseDocument( Reference< chart::XChartDocument >& rChartDoc, +void SchXMLExportHelper_Impl::parseDocument( Reference< chart::XChartDocument >& rChartDoc, sal_Bool bExportContent, sal_Bool bIncludeTable ) { @@ -1455,7 +1624,7 @@ void SchXMLExportHelper::parseDocument( Reference< chart::XChartDocument >& rCha delete pElChart; } -void SchXMLExportHelper::exportTable() +void SchXMLExportHelper_Impl::exportTable() { // table element // ------------- @@ -1593,7 +1762,7 @@ void SchXMLExportHelper::exportTable() OSL_ASSERT( bHasOwnData || (aFirstColumnRangeIter == aFirstColumnRangeEndIter) ); } -void SchXMLExportHelper::exportPlotArea( +void SchXMLExportHelper_Impl::exportPlotArea( Reference< chart::XDiagram > xDiagram, Reference< chart2::XDiagram > xNewDiagram, const awt::Size & rPageSize, @@ -1753,9 +1922,12 @@ void SchXMLExportHelper::exportPlotArea( } } - // element + // plot-area element pElPlotArea = new SvXMLElementExport( mrExport, XML_NAMESPACE_CHART, XML_PLOT_AREA, sal_True, sal_True ); + //inner position rectangle element + exportExcludingPosition( xDiagram ); + // light sources (inside plot area element) if( bIs3DChart && rShapeExport.is()) @@ -1916,7 +2088,27 @@ void SchXMLExportHelper::exportPlotArea( delete pElPlotArea; } -void SchXMLExportHelper::exportAxes( +void SchXMLExportHelper_Impl::exportExcludingPosition( const uno::Reference< chart::XDiagram >& xDiagram ) +{ + Reference< chart::XDiagramPositioning > xDiaPos( xDiagram, uno::UNO_QUERY ); + DBG_ASSERT( xDiaPos.is(), "Invalid xDiaPos as parameter" ); + if( !xDiaPos.is() ) + return; + + awt::Rectangle aRect( xDiaPos->calculateDiagramPositionExcludingAxes() ); + 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, XML_PREFER_EXCLUDING_POSITION, aString ); + + SvXMLElementExport aExcludingPosition( mrExport, XML_NAMESPACE_CHART, XML_EXCLUDING_POSITION, sal_True, sal_True ); +} + +void SchXMLExportHelper_Impl::exportAxes( const Reference< chart::XDiagram > & xDiagram, const Reference< chart2::XDiagram > & xNewDiagram, sal_Bool bExportContent ) @@ -2518,7 +2710,7 @@ void SchXMLExportHelper::exportAxes( } } -void SchXMLExportHelper::exportSeries( +void SchXMLExportHelper_Impl::exportSeries( const Reference< chart2::XDiagram > & xNewDiagram, const awt::Size & rPageSize, sal_Bool bExportContent, @@ -2887,7 +3079,7 @@ void SchXMLExportHelper::exportSeries( } } -void SchXMLExportHelper::exportRegressionCurve( +void SchXMLExportHelper_Impl::exportRegressionCurve( const Reference< chart2::XDataSeries > & xSeries, const Reference< beans::XPropertySet > & xSeriesProp, const awt::Size & rPageSize, @@ -2994,7 +3186,7 @@ void SchXMLExportHelper::exportRegressionCurve( } } -void SchXMLExportHelper::exportCandleStickSeries( +void SchXMLExportHelper_Impl::exportCandleStickSeries( const Sequence< Reference< chart2::XDataSeries > > & aSeriesSeq, const Reference< chart2::XDiagram > & xDiagram, sal_Bool bJapaneseCandleSticks, @@ -3112,7 +3304,7 @@ void SchXMLExportHelper::exportCandleStickSeries( } } -void SchXMLExportHelper::exportDataPoints( +void SchXMLExportHelper_Impl::exportDataPoints( const uno::Reference< beans::XPropertySet > & xSeriesProperties, sal_Int32 nSeriesLength, const uno::Reference< chart2::XDiagram > & xDiagram, @@ -3360,7 +3552,7 @@ void SchXMLExportHelper::exportDataPoints( } -void SchXMLExportHelper::getCellAddress( sal_Int32 nCol, sal_Int32 nRow ) +void SchXMLExportHelper_Impl::getCellAddress( sal_Int32 nCol, sal_Int32 nRow ) { msStringBuffer.append( (sal_Unicode)'.' ); if( nCol < 26 ) @@ -3380,7 +3572,7 @@ void SchXMLExportHelper::getCellAddress( sal_Int32 nCol, sal_Int32 nRow ) msStringBuffer.append( nRow + (sal_Int32)1 ); } -void SchXMLExportHelper::addPosition( const awt::Point & rPosition ) +void SchXMLExportHelper_Impl::addPosition( const awt::Point & rPosition ) { mrExport.GetMM100UnitConverter().convertMeasure( msStringBuffer, rPosition.X ); msString = msStringBuffer.makeStringAndClear(); @@ -3391,13 +3583,13 @@ void SchXMLExportHelper::addPosition( const awt::Point & rPosition ) mrExport.AddAttribute( XML_NAMESPACE_SVG, XML_Y, msString ); } -void SchXMLExportHelper::addPosition( Reference< drawing::XShape > xShape ) +void SchXMLExportHelper_Impl::addPosition( Reference< drawing::XShape > xShape ) { if( xShape.is()) addPosition( xShape->getPosition()); } -void SchXMLExportHelper::addSize( const awt::Size & rSize ) +void SchXMLExportHelper_Impl::addSize( const awt::Size & rSize ) { mrExport.GetMM100UnitConverter().convertMeasure( msStringBuffer, rSize.Width ); msString = msStringBuffer.makeStringAndClear(); @@ -3408,13 +3600,13 @@ void SchXMLExportHelper::addSize( const awt::Size & rSize ) mrExport.AddAttribute( XML_NAMESPACE_SVG, XML_HEIGHT, msString ); } -void SchXMLExportHelper::addSize( Reference< drawing::XShape > xShape ) +void SchXMLExportHelper_Impl::addSize( Reference< drawing::XShape > xShape ) { if( xShape.is()) addSize( xShape->getSize() ); } -awt::Size SchXMLExportHelper::getPageSize( const Reference< chart2::XChartDocument > & xChartDoc ) const +awt::Size SchXMLExportHelper_Impl::getPageSize( const Reference< chart2::XChartDocument > & xChartDoc ) const { awt::Size aSize( 8000, 7000 ); uno::Reference< embed::XVisualObject > xVisualObject( xChartDoc, uno::UNO_QUERY ); @@ -3425,7 +3617,7 @@ awt::Size SchXMLExportHelper::getPageSize( const Reference< chart2::XChartDocume return aSize; } -void SchXMLExportHelper::swapDataArray( Sequence< Sequence< double > >& rSequence ) +void SchXMLExportHelper_Impl::swapDataArray( Sequence< Sequence< double > >& rSequence ) { sal_Int32 nOuterSize = rSequence.getLength(); sal_Int32 nInnerSize = rSequence[0].getLength(); // assume that all subsequences have same length @@ -3443,13 +3635,13 @@ void SchXMLExportHelper::swapDataArray( Sequence< Sequence< double > >& rSequenc rSequence = aResult; } -void SchXMLExportHelper::CollectAutoStyle( const std::vector< XMLPropertyState >& aStates ) +void SchXMLExportHelper_Impl::CollectAutoStyle( const std::vector< XMLPropertyState >& aStates ) { if( !aStates.empty() ) maAutoStyleNameQueue.push( GetAutoStylePoolP().Add( XML_STYLE_FAMILY_SCH_CHART_ID, aStates )); } -void SchXMLExportHelper::AddAutoStyleAttribute( const std::vector< XMLPropertyState >& aStates ) +void SchXMLExportHelper_Impl::AddAutoStyleAttribute( const std::vector< XMLPropertyState >& aStates ) { if( !aStates.empty() ) { @@ -3460,7 +3652,7 @@ void SchXMLExportHelper::AddAutoStyleAttribute( const std::vector< XMLPropertySt } } -void SchXMLExportHelper::exportText( const OUString& rText, bool bConvertTabsLFs ) +void SchXMLExportHelper_Impl::exportText( const OUString& rText, bool bConvertTabsLFs ) { SchXMLTools::exportText( mrExport, rText, bConvertTabsLFs ); } @@ -3493,7 +3685,7 @@ SchXMLExport::~SchXMLExport() sal_uInt32 SchXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass ) { Reference< chart2::XChartDocument > xChartDoc( GetModel(), uno::UNO_QUERY ); - maExportHelper.InitRangeSegmentationProperties( xChartDoc ); + maExportHelper.m_pImpl->InitRangeSegmentationProperties( xChartDoc ); return SvXMLExport::exportDoc( eClass ); } @@ -3516,8 +3708,8 @@ void SchXMLExport::_ExportAutoStyles() Reference< chart::XChartDocument > xChartDoc( GetModel(), uno::UNO_QUERY ); if( xChartDoc.is()) { - maExportHelper.collectAutoStyles( xChartDoc ); - maExportHelper.exportAutoStyles(); + maExportHelper.m_pImpl->collectAutoStyles( xChartDoc ); + maExportHelper.m_pImpl->exportAutoStyles(); } else { @@ -3566,13 +3758,13 @@ void SchXMLExport::_ExportContent() aAny = xProp->getPropertyValue( OUString::createFromAscii( "ChartRangeAddress" )); aAny >>= sChartAddress; - maExportHelper.SetChartRangeAddress( sChartAddress ); + maExportHelper.m_pImpl->SetChartRangeAddress( sChartAddress ); OUString sTableNumberList; aAny = xProp->getPropertyValue( OUString::createFromAscii( "TableNumberList" )); aAny >>= sTableNumberList; - maExportHelper.SetTableNumberList( sTableNumberList ); + maExportHelper.m_pImpl->SetTableNumberList( sTableNumberList ); // do not include own table if there are external addresses bIncludeTable = (sChartAddress.getLength() == 0); @@ -3585,7 +3777,7 @@ void SchXMLExport::_ExportContent() } } } - maExportHelper.exportChart( xChartDoc, bIncludeTable ); + maExportHelper.m_pImpl->exportChart( xChartDoc, bIncludeTable ); } else { @@ -3600,7 +3792,12 @@ void SchXMLExport::SetProgress( sal_Int32 nPercentage ) mxStatusIndicator->setValue( nPercentage ); } -void SchXMLExportHelper::InitRangeSegmentationProperties( const Reference< chart2::XChartDocument > & xChartDoc ) +UniReference< XMLPropertySetMapper > SchXMLExport::GetPropertySetMapper() const +{ + return maExportHelper.m_pImpl->GetPropertySetMapper(); +} + +void SchXMLExportHelper_Impl::InitRangeSegmentationProperties( const Reference< chart2::XChartDocument > & xChartDoc ) { if( xChartDoc.is()) try diff --git a/xmloff/source/chart/SchXMLImport.cxx b/xmloff/source/chart/SchXMLImport.cxx index dd955e6d69d5..1087845f965e 100644 --- a/xmloff/source/chart/SchXMLImport.cxx +++ b/xmloff/source/chart/SchXMLImport.cxx @@ -285,6 +285,7 @@ const SvXMLTokenMap& SchXMLImportHelper::GetPlotAreaElemTokenMap() { static __FAR_DATA SvXMLTokenMapEntry aPlotAreaElemTokenMap[] = { + { XML_NAMESPACE_CHART, XML_EXCLUDING_POSITION, XML_TOK_PA_EXCLUDING_POSITION }, { XML_NAMESPACE_CHART, XML_AXIS, XML_TOK_PA_AXIS }, { XML_NAMESPACE_CHART, XML_SERIES, XML_TOK_PA_SERIES }, { XML_NAMESPACE_CHART, XML_WALL, XML_TOK_PA_WALL }, diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx index 8bb4712b4159..37fa8249d9c8 100644 --- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx +++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx @@ -64,6 +64,7 @@ #include #include #include +#include #include #include @@ -202,8 +203,8 @@ SchXMLPlotAreaContext::SchXMLPlotAreaContext( mnSeries( 0 ), m_aGlobalSeriesImportInfo( rAllRangeAddressesAvailable ), maSceneImportHelper( rImport ), - mbHasSize(false), - mbHasPosition(false), + m_aOuterPositioning( rImport ), + m_aInnerPositioning( rImport ), mbPercentStacked(false), m_bAxisPositionAttributeImported(false), m_rXLinkHRefAttributeToIndicateDataProvider(rXLinkHRefAttributeToIndicateDataProvider), @@ -299,15 +300,6 @@ SchXMLPlotAreaContext::~SchXMLPlotAreaContext() void SchXMLPlotAreaContext::StartElement( const uno::Reference< xml::sax::XAttributeList >& xAttrList ) { - uno::Any aTransMatrixAny; - - // initialize size and position - uno::Reference< drawing::XShape > xDiaShape( mxDiagram, uno::UNO_QUERY ); - bool bHasSizeWidth = false; - bool bHasSizeHeight = false; - bool bHasPositionX = false; - bool bHasPositionY = false; - // parse attributes sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0; const SvXMLTokenMap& rAttrTokenMap = mrImportHelper.GetPlotAreaAttrTokenMap(); @@ -323,20 +315,10 @@ void SchXMLPlotAreaContext::StartElement( const uno::Reference< xml::sax::XAttri switch( rAttrTokenMap.Get( nPrefix, aLocalName )) { case XML_TOK_PA_X: - GetImport().GetMM100UnitConverter().convertMeasure( maPosition.X, aValue ); - bHasPositionX = true; - break; case XML_TOK_PA_Y: - GetImport().GetMM100UnitConverter().convertMeasure( maPosition.Y, aValue ); - bHasPositionY = true; - break; case XML_TOK_PA_WIDTH: - GetImport().GetMM100UnitConverter().convertMeasure( maSize.Width, aValue ); - bHasSizeWidth = true; - break; case XML_TOK_PA_HEIGHT: - GetImport().GetMM100UnitConverter().convertMeasure( maSize.Height, aValue ); - bHasSizeHeight = true; + m_aOuterPositioning.readPositioningAttribute( nPrefix, aLocalName, aValue ); break; case XML_TOK_PA_STYLE_NAME: msAutoStyleName = aValue; @@ -372,9 +354,6 @@ void SchXMLPlotAreaContext::StartElement( const uno::Reference< xml::sax::XAttri } } - mbHasSize = bHasSizeWidth && bHasSizeHeight; - mbHasPosition = bHasPositionX && bHasPositionY; - if( ! mxNewDoc.is()) { uno::Reference< beans::XPropertySet > xDocProp( mrImportHelper.GetChartDocument(), uno::UNO_QUERY ); @@ -429,14 +408,7 @@ void SchXMLPlotAreaContext::StartElement( const uno::Reference< xml::sax::XAttri ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Lines")), pPropStyleContext, pStylesCtxt ); //handle automatic position and size - bool bAutoSize = false; - bool bAutoPosition = false; - SchXMLTools::getPropertyFromContext( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AutomaticSize")), pPropStyleContext, pStylesCtxt ) >>= bAutoSize; - SchXMLTools::getPropertyFromContext( - ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AutomaticPosition")), pPropStyleContext, pStylesCtxt ) >>= bAutoPosition; - mbHasSize = mbHasSize && !bAutoSize; - mbHasPosition = mbHasPosition && !bAutoPosition; + m_aOuterPositioning.readAutomaticPositioningProperties( pPropStyleContext, pStylesCtxt ); //correct default starting angle for old 3D pies if( SchXMLTools::isDocumentGeneratedWithOpenOfficeOlderThan3_0( GetImport().GetModel() ) ) @@ -551,6 +523,12 @@ SvXMLImportContext* SchXMLPlotAreaContext::CreateChildContext( switch( rTokenMap.Get( nPrefix, rLocalName )) { + case XML_TOK_PA_EXCLUDING_POSITION: + { + pContext = new SchXMLExcludingPositionContext( GetImport(), nPrefix, rLocalName, m_aInnerPositioning ); + } + break; + case XML_TOK_PA_AXIS: { bool bAddMissingXAxisForNetCharts = false; @@ -714,13 +692,14 @@ void SchXMLPlotAreaContext::EndElement() } // set changed size and position after properties (esp. 3d) - uno::Reference< drawing::XShape > xDiaShape( mxDiagram, uno::UNO_QUERY ); - if( xDiaShape.is()) + + uno::Reference< chart::XDiagramPositioning > xDiaPos( mxDiagram, uno::UNO_QUERY ); + if( xDiaPos.is()) { - if( mbHasSize ) - xDiaShape->setSize( maSize ); - if( mbHasPosition ) - xDiaShape->setPosition( maPosition ); + if( m_aInnerPositioning.hasPosSize() ) + xDiaPos->setDiagramPositionExcludingAxes( m_aInnerPositioning.getRectangle() ); + else if( m_aOuterPositioning.hasPosSize() ) + xDiaPos->setDiagramPositionIncludingAxesAndAxesTitles( m_aOuterPositioning.getRectangle() ); } CorrectAxisPositions(); @@ -1680,6 +1659,143 @@ void SchXMLCategoriesContext::StartElement( const uno::Reference< xml::sax::XAtt // ======================================== +SchXMLPositonAttributesHelper::SchXMLPositonAttributesHelper( SvXMLImport& rImporter ) + : m_rImport( rImporter ) + , m_aPosition(0,0) + , m_aSize(0,0) + , m_bHasSizeWidth( false ) + , m_bHasSizeHeight( false ) + , m_bHasPositionX( false ) + , m_bHasPositionY( false ) + , m_bAutoSize( false ) + , m_bAutoPosition( false ) +{ +} + +SchXMLPositonAttributesHelper::~SchXMLPositonAttributesHelper() +{ +} + +bool SchXMLPositonAttributesHelper::hasSize() const +{ + return m_bHasSizeWidth && m_bHasSizeHeight && !m_bAutoSize; +} +bool SchXMLPositonAttributesHelper::hasPosition() const +{ + return m_bHasPositionX && m_bHasPositionY && !m_bAutoPosition; +} +bool SchXMLPositonAttributesHelper::hasPosSize() const +{ + return hasPosition() && hasSize(); +} +awt::Point SchXMLPositonAttributesHelper::getPosition() const +{ + return m_aPosition; +} +awt::Size SchXMLPositonAttributesHelper::getSize() const +{ + return m_aSize; +} +awt::Rectangle SchXMLPositonAttributesHelper::getRectangle() const +{ + return awt::Rectangle( m_aPosition.X, m_aPosition.Y, m_aSize.Width, m_aSize.Height ); +} + +bool SchXMLPositonAttributesHelper::readPositioningAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue ) +{ + //returns true if the attribute was proccessed + bool bReturn = true; + + if( XML_NAMESPACE_SVG == nPrefix ) + { + if( IsXMLToken( rLocalName, XML_X ) ) + { + m_rImport.GetMM100UnitConverter().convertMeasure( m_aPosition.X, rValue ); + m_bHasPositionX = true; + } + else if( IsXMLToken( rLocalName, XML_Y ) ) + { + m_rImport.GetMM100UnitConverter().convertMeasure( m_aPosition.Y, rValue ); + m_bHasPositionY = true; + } + else if( IsXMLToken( rLocalName, XML_WIDTH ) ) + { + m_rImport.GetMM100UnitConverter().convertMeasure( m_aSize.Width, rValue ); + m_bHasSizeWidth = true; + } + else if( IsXMLToken( rLocalName, XML_HEIGHT ) ) + { + m_rImport.GetMM100UnitConverter().convertMeasure( m_aSize.Height, rValue ); + m_bHasSizeHeight = true; + } + else + bReturn = false; + } + else if( XML_NAMESPACE_CHART == nPrefix ) + { + //Attribute( XML_NAMESPACE_CHART, XML_PREFER_EXCLUDING_POSITION + + sal_Bool bPreferExcludingPosition = false; + if( IsXMLToken( rLocalName, XML_PREFER_EXCLUDING_POSITION ) ) + { + m_rImport.GetMM100UnitConverter().convertBool( bPreferExcludingPosition, rValue ); + m_bAutoPosition = m_bAutoSize = !bPreferExcludingPosition; + } + else + bReturn = false; + } + else + bReturn = false; + + return bReturn; +} + + +void SchXMLPositonAttributesHelper::readAutomaticPositioningProperties( XMLPropStyleContext* pPropStyleContext, const SvXMLStylesContext* pStylesCtxt ) +{ + if( pPropStyleContext && pStylesCtxt ) + { + //handle automatic position and size + SchXMLTools::getPropertyFromContext( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AutomaticSize")), pPropStyleContext, pStylesCtxt ) >>= m_bAutoSize; + SchXMLTools::getPropertyFromContext( + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AutomaticPosition")), pPropStyleContext, pStylesCtxt ) >>= m_bAutoPosition; + } +} + +// ======================================== + +SchXMLExcludingPositionContext::SchXMLExcludingPositionContext( + SvXMLImport& rImport + , sal_uInt16 nPrefix + , const rtl::OUString& rLocalName + , SchXMLPositonAttributesHelper& rPositioning ) + : SvXMLImportContext( rImport, nPrefix, rLocalName ) + , m_rPositioning( rPositioning ) +{ +} + +SchXMLExcludingPositionContext::~SchXMLExcludingPositionContext() +{ +} + +void SchXMLExcludingPositionContext::StartElement( const uno::Reference< xml::sax::XAttributeList >& xAttrList ) +{ + // parse attributes + sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0; + + for( sal_Int16 i = 0; i < nAttrCount; i++ ) + { + rtl::OUString sAttrName = xAttrList->getNameByIndex( i ); + rtl::OUString aLocalName; + rtl::OUString aValue = xAttrList->getValueByIndex( i ); + USHORT nPrefix = GetImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName ); + m_rPositioning.readPositioningAttribute( nPrefix, aLocalName, aValue ); + } +} + +// ======================================== + SchXMLWallFloorContext::SchXMLWallFloorContext( SchXMLImportHelper& rImpHelper, SvXMLImport& rImport, diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.hxx b/xmloff/source/chart/SchXMLPlotAreaContext.hxx index ed01ad2fa8da..af6f600200d5 100644 --- a/xmloff/source/chart/SchXMLPlotAreaContext.hxx +++ b/xmloff/source/chart/SchXMLPlotAreaContext.hxx @@ -69,6 +69,42 @@ private: SchXML3DSceneAttributesHelper(); }; +// ---------------------------------------- + +class SchXMLPositonAttributesHelper +{ +public: + SchXMLPositonAttributesHelper( SvXMLImport& rImporter ); + ~SchXMLPositonAttributesHelper(); + + bool readPositioningAttribute( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::rtl::OUString& rValue ); + void readAutomaticPositioningProperties( XMLPropStyleContext* pPropStyleContext, const SvXMLStylesContext* pStylesCtxt ); + + bool hasPosSize() const; + ::com::sun::star::awt::Rectangle getRectangle() const; + + +private: + bool hasSize() const; + bool hasPosition() const; + ::com::sun::star::awt::Size getSize() const; + ::com::sun::star::awt::Point getPosition() const; + + SvXMLImport& m_rImport; + + ::com::sun::star::awt::Point m_aPosition; + ::com::sun::star::awt::Size m_aSize; + + bool m_bHasSizeWidth; + bool m_bHasSizeHeight; + bool m_bHasPositionX; + bool m_bHasPositionY; + sal_Bool m_bAutoSize; + sal_Bool m_bAutoPosition; +}; + +// ---------------------------------------- + class SchXMLPlotAreaContext : public SvXMLImportContext { public: @@ -113,10 +149,8 @@ private: GlobalSeriesImportInfo m_aGlobalSeriesImportInfo; SchXML3DSceneAttributesHelper maSceneImportHelper; - ::com::sun::star::awt::Size maSize; - ::com::sun::star::awt::Point maPosition; - bool mbHasSize; - bool mbHasPosition; + SchXMLPositonAttributesHelper m_aOuterPositioning;//including axes and axes titles + SchXMLPositonAttributesHelper m_aInnerPositioning;//excluding axes and axes titles bool mbPercentStacked; bool m_bAxisPositionAttributeImported; ::rtl::OUString msAutoStyleName; @@ -219,6 +253,23 @@ public: // ---------------------------------------- +class SchXMLExcludingPositionContext : public SvXMLImportContext +{ +public: + SchXMLExcludingPositionContext( + SvXMLImport& rImport + , sal_uInt16 nPrefix + , const rtl::OUString& rLocalName + , SchXMLPositonAttributesHelper& rPositioning ); + virtual ~SchXMLExcludingPositionContext(); + virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); + +private: + SchXMLPositonAttributesHelper& m_rPositioning; +}; + +// ---------------------------------------- + class SchXMLWallFloorContext : public SvXMLImportContext { public: diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx index ae95763f1936..8b0155d1b08a 100644 --- a/xmloff/source/core/xmltoken.cxx +++ b/xmloff/source/core/xmltoken.cxx @@ -3095,6 +3095,9 @@ namespace xmloff { namespace token { TOKEN( "ends-with", XML_ENDS_WITH ), TOKEN( "does-not-end-with", XML_DOES_NOT_END_WITH ), + TOKEN( "excluding-position", XML_EXCLUDING_POSITION ), + TOKEN( "prefer-excluding-position", XML_PREFER_EXCLUDING_POSITION ), + #if OSL_DEBUG_LEVEL > 0 { 0, NULL, NULL, XML_TOKEN_END } #else diff --git a/xmloff/source/draw/shapeexport2.cxx b/xmloff/source/draw/shapeexport2.cxx index b2e81d333fba..b55942cfb00c 100644 --- a/xmloff/source/draw/shapeexport2.cxx +++ b/xmloff/source/draw/shapeexport2.cxx @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include @@ -1250,27 +1249,6 @@ void XMLShapeExport::ImpExportChartShape( SvXMLAttributeList* pAttrList ) { ImpExportOLE2Shape( xShape, eShapeType, nFeatures, pRefPoint, pAttrList ); -/* - // Transformation - ImpExportNewTrans(xPropSet, nFeatures, pRefPoint); - - uno::Reference< chart::XChartDocument > xChartDoc; - if( !bIsEmptyPresObj ) - xPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("Model") ) ) >>= xChartDoc; - - if( xChartDoc.is() ) - { - // export chart data if the flag is not set (default) - sal_Bool bExportOwnData = ( nFeatures & SEF_EXPORT_NO_CHART_DATA ) == 0; - mrExport.GetChartExport()->exportChart( xChartDoc, bExportOwnData ); - } - else - { - // write chart object (fake for now, replace later) - SvXMLElementExport aOBJ(mrExport, XML_NAMESPACE_CHART, XML_CHART, sal_True, sal_True); - } - } -*/ } ////////////////////////////////////////////////////////////////////////////// -- cgit From 24be43ab5287828705356e22421cc7fc47fa30a4 Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Tue, 23 Feb 2010 00:23:09 +0100 Subject: presentation placeholder rework --- xmloff/source/draw/shapeexport.cxx | 12 ++++++++++-- xmloff/source/draw/shapeexport2.cxx | 5 ++++- xmloff/source/draw/shapeexport4.cxx | 6 +++--- xmloff/source/draw/ximpshap.cxx | 37 +++++++++++++++++++++++++++++++++---- 4 files changed, 50 insertions(+), 10 deletions(-) (limited to 'xmloff/source') diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 3a0e01631f28..49d6a87831f0 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -762,6 +762,7 @@ void XMLShapeExport::exportShape(const uno::Reference< drawing::XShape >& xShape break; } + case XmlShapeTypePresTableShape: case XmlShapeTypeDrawTableShape: { ImpExportTableShape( xShape, aShapeInfo.meShapeType, nFeatures, pRefPoint ); @@ -831,6 +832,7 @@ void XMLShapeExport::exportShape(const uno::Reference< drawing::XShape >& xShape break; } + case XmlShapeTypePresMediaShape: case XmlShapeTypeDrawMediaShape: { ImpExportMediaShape( xShape, aShapeInfo.meShapeType, nFeatures, pRefPoint ); @@ -1088,7 +1090,7 @@ void XMLShapeExport::ImpCalcShapeType(const uno::Reference< drawing::XShape >& x // get info about presentation shape uno::Reference xPropSet(xShape, uno::UNO_QUERY); - if(xPropSet.is()) + if(xPropSet.is()) try { rtl::OUString sCLSID; if(xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("CLSID"))) >>= sCLSID) @@ -1100,16 +1102,22 @@ void XMLShapeExport::ImpCalcShapeType(const uno::Reference< drawing::XShape >& x } } } + catch( uno::Exception& ) + { + DBG_ERROR( "XMLShapeExport::ImpCalcShapeType(), expected ole shape to have the CLSID property?" ); + } } else if(aType.EqualsAscii("Chart", 26, 5)) { eShapeType = XmlShapeTypePresChartShape; } else if(aType.EqualsAscii("OrgChart", 26, 8)) { eShapeType = XmlShapeTypePresOrgChartShape; } - else if(aType.EqualsAscii("TableShape", 26, 10)) { eShapeType = XmlShapeTypePresSheetShape; } + else if(aType.EqualsAscii("CalcShape", 26, 9)) { eShapeType = XmlShapeTypePresSheetShape; } + else if(aType.EqualsAscii("TableShape", 26, 10)) { eShapeType = XmlShapeTypePresTableShape; } else if(aType.EqualsAscii("Notes", 26, 5)) { eShapeType = XmlShapeTypePresNotesShape; } else if(aType.EqualsAscii("HandoutShape", 26, 12)) { eShapeType = XmlShapeTypeHandoutShape; } else if(aType.EqualsAscii("HeaderShape", 26, 11)) { eShapeType = XmlShapeTypePresHeaderShape; } else if(aType.EqualsAscii("FooterShape", 26, 11)) { eShapeType = XmlShapeTypePresFooterShape; } else if(aType.EqualsAscii("SlideNumberShape", 26, 16)) { eShapeType = XmlShapeTypePresSlideNumberShape; } else if(aType.EqualsAscii("DateTimeShape", 26, 13)) { eShapeType = XmlShapeTypePresDateTimeShape; } + else if(aType.EqualsAscii("MediaShape", 21, 10)) { eShapeType = XmlShapeTypePresMediaShape; } } } } diff --git a/xmloff/source/draw/shapeexport2.cxx b/xmloff/source/draw/shapeexport2.cxx index e09ad66dfeb9..40e8b9d874fa 100644 --- a/xmloff/source/draw/shapeexport2.cxx +++ b/xmloff/source/draw/shapeexport2.cxx @@ -1999,7 +1999,7 @@ void XMLShapeExport::ImpExportPluginShape( void XMLShapeExport::ImpExportMediaShape( const uno::Reference< drawing::XShape >& xShape, - XmlShapeType, sal_Int32 nFeatures, com::sun::star::awt::Point* pRefPoint) + XmlShapeType eShapeType, sal_Int32 nFeatures, com::sun::star::awt::Point* pRefPoint) { const uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY); if(xPropSet.is()) @@ -2007,6 +2007,9 @@ void XMLShapeExport::ImpExportMediaShape( // Transformation ImpExportNewTrans(xPropSet, nFeatures, pRefPoint); + if(eShapeType == XmlShapeTypePresMediaShape) + ImpExportPresentationAttributes( xPropSet, GetXMLToken(XML_PRESENTATION_OBJECT) ); + sal_Bool bCreateNewline( (nFeatures & SEF_EXPORT_NO_WS) == 0 ); // #86116#/#92210# SvXMLElementExport aElem( mrExport, XML_NAMESPACE_DRAW, XML_FRAME, bCreateNewline, sal_True ); diff --git a/xmloff/source/draw/shapeexport4.cxx b/xmloff/source/draw/shapeexport4.cxx index e2e804eefb43..efe0b4fa668d 100644 --- a/xmloff/source/draw/shapeexport4.cxx +++ b/xmloff/source/draw/shapeexport4.cxx @@ -1098,7 +1098,7 @@ void XMLShapeExport::ImpExportCustomShape( } } -void XMLShapeExport::ImpExportTableShape( const uno::Reference< drawing::XShape >& xShape, XmlShapeType /*eShapeType*/, sal_Int32 nFeatures, com::sun::star::awt::Point* pRefPoint ) +void XMLShapeExport::ImpExportTableShape( const uno::Reference< drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures, com::sun::star::awt::Point* pRefPoint ) { uno::Reference< beans::XPropertySet > xPropSet(xShape, uno::UNO_QUERY); uno::Reference< container::XNamed > xNamed(xShape, uno::UNO_QUERY); @@ -1112,8 +1112,8 @@ void XMLShapeExport::ImpExportTableShape( const uno::Reference< drawing::XShape sal_Bool bIsEmptyPresObj = sal_False; // presentation settings -// if(eShapeType == XmlShapeTypePresTableShape) -// bIsEmptyPresObj = ImpExportPresentationAttributes( xPropSet, GetXMLToken(XML_PRESENTATION_TABLE) ); + if(eShapeType == XmlShapeTypePresTableShape) + bIsEmptyPresObj = ImpExportPresentationAttributes( xPropSet, GetXMLToken(XML_PRESENTATION_TABLE) ); const bool bCreateNewline( (nFeatures & SEF_EXPORT_NO_WS) == 0 ); const bool bExportEmbedded(0 != (mrExport.getExportFlags() & EXPORT_EMBEDDED)); diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index 65aad96bad86..95f2d6b80058 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -2551,7 +2551,7 @@ void SdXMLObjectShapeContext::StartElement( const ::com::sun::star::uno::Referen } else if( IsXMLToken( maPresentationClass, XML_PRESENTATION_TABLE ) ) { - pService = "com.sun.star.presentation.TableShape"; + pService = "com.sun.star.presentation.CalcShape"; } else if( IsXMLToken( maPresentationClass, XML_PRESENTATION_OBJECT ) ) { @@ -2908,8 +2908,21 @@ void SdXMLPluginShapeContext::StartElement( const ::com::sun::star::uno::Referen const char* pService; + sal_Bool bIsPresShape = sal_False; + if( mbMedia ) + { pService = "com.sun.star.drawing.MediaShape"; + + bIsPresShape = maPresentationClass.getLength() && GetImport().GetShapeImport()->IsPresentationShapesSupported(); + if( bIsPresShape ) + { + if( IsXMLToken( maPresentationClass, XML_PRESENTATION_OBJECT ) ) + { + pService = "com.sun.star.presentation.MediaShape"; + } + } + } else pService = "com.sun.star.drawing.PluginShape"; @@ -2919,6 +2932,23 @@ void SdXMLPluginShapeContext::StartElement( const ::com::sun::star::uno::Referen { SetLayer(); + if(bIsPresShape) + { + uno::Reference< beans::XPropertySet > xProps( mxShape, uno::UNO_QUERY ); + if(xProps.is()) + { + uno::Reference< beans::XPropertySetInfo > xPropsInfo( xProps->getPropertySetInfo() ); + if( xPropsInfo.is() ) + { + if( !mbIsPlaceholder && xPropsInfo->hasPropertyByName(OUString(RTL_CONSTASCII_USTRINGPARAM("IsEmptyPresentationObject") ))) + xProps->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("IsEmptyPresentationObject") ), ::cppu::bool2any( sal_False ) ); + + if( mbIsUserTransformed && xPropsInfo->hasPropertyByName(OUString(RTL_CONSTASCII_USTRINGPARAM("IsPlaceholderDependent") ))) + xProps->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("IsPlaceholderDependent") ), ::cppu::bool2any( sal_False ) ); + } + } + } + // set pos, size, shear and rotate SetTransformation(); GetImport().GetShapeImport()->finishShape( mxShape, mxAttrList, mxShapes ); @@ -3531,8 +3561,7 @@ void SdXMLTableShapeContext::StartElement( const ::com::sun::star::uno::Referenc { const char* pService = "com.sun.star.drawing.TableShape"; - sal_Bool bIsPresShape = sal_False; //maPresentationClass.getLength() && GetImport().GetShapeImport()->IsPresentationShapesSupported(); -/* + sal_Bool bIsPresShape = maPresentationClass.getLength() && GetImport().GetShapeImport()->IsPresentationShapesSupported(); if( bIsPresShape ) { if( IsXMLToken( maPresentationClass, XML_PRESENTATION_TABLE ) ) @@ -3540,7 +3569,7 @@ void SdXMLTableShapeContext::StartElement( const ::com::sun::star::uno::Referenc pService = "com.sun.star.presentation.TableShape"; } } -*/ + AddShape( pService ); if( mxShape.is() ) -- cgit From 3dbbaa9d0eb6259a346f485e52086459f895215e Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Wed, 24 Feb 2010 13:11:19 +0100 Subject: fixed storing issue with presentation tables --- xmloff/source/draw/shapeexport.cxx | 1 + xmloff/source/table/XMLTableExport.cxx | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'xmloff/source') diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 49d6a87831f0..3db1e336410f 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -470,6 +470,7 @@ void XMLShapeExport::collectShapeAutoStyles(const uno::Reference< drawing::XShap mrExport.getInterfaceToIdentifierMapper().registerReference( xConnection ); break; } + case XmlShapeTypePresTableShape: case XmlShapeTypeDrawTableShape: { try diff --git a/xmloff/source/table/XMLTableExport.cxx b/xmloff/source/table/XMLTableExport.cxx index de930d6dd288..29e9c6c257dc 100644 --- a/xmloff/source/table/XMLTableExport.cxx +++ b/xmloff/source/table/XMLTableExport.cxx @@ -356,6 +356,8 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates ) // get the current row Reference< XCellRange > xCellRange( xIndexAccess->getByIndex(rowIndex), UNO_QUERY_THROW ); + OUString sDefaultCellStyle; + // table:style-name if( pTableInfo.get() ) { @@ -363,11 +365,11 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates ) const OUString sStyleName( pTableInfo->maRowStyleMap[xKey] ); if( sStyleName.getLength() ) mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_STYLE_NAME, sStyleName ); - } - const OUString sDefaultCellStyle( pTableInfo->maDefaultRowCellStyles[rowIndex] ); - if( sDefaultCellStyle.getLength() ) - mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DEFAULT_CELL_STYLE_NAME, sDefaultCellStyle ); + sDefaultCellStyle = pTableInfo->maDefaultRowCellStyles[rowIndex]; + if( sDefaultCellStyle.getLength() ) + mrExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DEFAULT_CELL_STYLE_NAME, sDefaultCellStyle ); + } // write row element SvXMLElementExport tableRowElement( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_ROW, sal_True, sal_True ); -- cgit From 3138e431cb23a6ba95d16713ce30a54451566665 Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Thu, 25 Feb 2010 18:04:05 +0100 Subject: more fixes for new presentation layout shapes --- xmloff/source/draw/shapeexport.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xmloff/source') diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 3db1e336410f..f1941e715a96 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -1118,7 +1118,7 @@ void XMLShapeExport::ImpCalcShapeType(const uno::Reference< drawing::XShape >& x else if(aType.EqualsAscii("FooterShape", 26, 11)) { eShapeType = XmlShapeTypePresFooterShape; } else if(aType.EqualsAscii("SlideNumberShape", 26, 16)) { eShapeType = XmlShapeTypePresSlideNumberShape; } else if(aType.EqualsAscii("DateTimeShape", 26, 13)) { eShapeType = XmlShapeTypePresDateTimeShape; } - else if(aType.EqualsAscii("MediaShape", 21, 10)) { eShapeType = XmlShapeTypePresMediaShape; } + else if(aType.EqualsAscii("MediaShape", 26, 10)) { eShapeType = XmlShapeTypePresMediaShape; } } } } -- cgit From b7db16a355f9bfbab65e1a88e1e4dede35bf7357 Mon Sep 17 00:00:00 2001 From: Ingrid Halama Date: Wed, 31 Mar 2010 18:43:41 +0200 Subject: chartpositioning: #i98398# treat diagram size without title sizes (correct ODF import/export, correct diagram sizing per mouse, correct API for import) --- xmloff/source/chart/SchXMLPlotAreaContext.cxx | 25 ++++++++++++++++++++----- xmloff/source/chart/SchXMLPlotAreaContext.hxx | 1 + xmloff/source/chart/SchXMLTools.cxx | 21 +++++++++++++++++++++ xmloff/source/chart/SchXMLTools.hxx | 1 + 4 files changed, 43 insertions(+), 5 deletions(-) (limited to 'xmloff/source') diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx index 7b7802a8f295..3621789099b6 100644 --- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx +++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx @@ -693,10 +693,21 @@ 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() ) - xDiaPos->setDiagramPositionExcludingAxes( m_aInnerPositioning.getRectangle() ); - else if( m_aOuterPositioning.hasPosSize() ) - xDiaPos->setDiagramPositionIncludingAxesAndAxesTitles( m_aOuterPositioning.getRectangle() ); + { + if( !m_aInnerPositioning.isAutomatic() ) + xDiaPos->setDiagramPositionExcludingAxes( m_aInnerPositioning.getRectangle() ); + else if( bOuterSize ) + xDiaPos->setDiagramPositionIncludingAxes( m_aOuterPositioning.getRectangle() ); + } + else if( bOuterSize ) + { + if( SchXMLTools::isDocumentGeneratedWithOpenOfficeOlderThan3_4( GetImport().GetModel() ) ) //old version of OOo did write a wrong rectangle for the diagram size + xDiaPos->setDiagramPositionIncludingAxesAndAxesTitles( m_aOuterPositioning.getRectangle() ); + else + xDiaPos->setDiagramPositionIncludingAxes( m_aOuterPositioning.getRectangle() ); + } } CorrectAxisPositions(); @@ -1675,16 +1686,20 @@ SchXMLPositonAttributesHelper::~SchXMLPositonAttributesHelper() bool SchXMLPositonAttributesHelper::hasSize() const { - return m_bHasSizeWidth && m_bHasSizeHeight && !m_bAutoSize; + return m_bHasSizeWidth && m_bHasSizeHeight; } bool SchXMLPositonAttributesHelper::hasPosition() const { - return m_bHasPositionX && m_bHasPositionY && !m_bAutoPosition; + return m_bHasPositionX && m_bHasPositionY; } bool SchXMLPositonAttributesHelper::hasPosSize() const { return hasPosition() && hasSize(); } +bool SchXMLPositonAttributesHelper::isAutomatic() const +{ + return m_bAutoSize || m_bAutoPosition; +} awt::Point SchXMLPositonAttributesHelper::getPosition() const { return m_aPosition; diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.hxx b/xmloff/source/chart/SchXMLPlotAreaContext.hxx index 632abe209188..cb986d7e7a3d 100644 --- a/xmloff/source/chart/SchXMLPlotAreaContext.hxx +++ b/xmloff/source/chart/SchXMLPlotAreaContext.hxx @@ -78,6 +78,7 @@ public: void readAutomaticPositioningProperties( XMLPropStyleContext* pPropStyleContext, const SvXMLStylesContext* pStylesCtxt ); bool hasPosSize() const; + bool isAutomatic() const; ::com::sun::star::awt::Rectangle getRectangle() const; diff --git a/xmloff/source/chart/SchXMLTools.cxx b/xmloff/source/chart/SchXMLTools.cxx index f5059f979b63..f836f1c1de7c 100644 --- a/xmloff/source/chart/SchXMLTools.cxx +++ b/xmloff/source/chart/SchXMLTools.cxx @@ -705,6 +705,27 @@ void setBuildIDAtImportInfo( uno::Reference< frame::XModel > xModel, Reference< SvXMLMetaDocumentContext::setBuildId( aGenerator, xImportInfo ); } +bool isDocumentGeneratedWithOpenOfficeOlderThan3_4( const uno::Reference< frame::XModel >& xChartModel ) +{ + bool bResult = isDocumentGeneratedWithOpenOfficeOlderThan3_0( xChartModel ); + if( !bResult ) + { + ::rtl::OUString aGenerator( lcl_getGeneratorFromModel(xChartModel) ); + if( aGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OpenOffice.org_project/3") ) ) != -1 ) + { + if( aGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OpenOffice.org_project/300m") ) ) != -1 ) + bResult= true; + else if( aGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OpenOffice.org_project/310m") ) ) != -1 ) + bResult= true; + else if( aGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OpenOffice.org_project/320m") ) ) != -1 ) + bResult= true; + else if( aGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OpenOffice.org_project/330m") ) ) != -1 ) + bResult= true; + } + } + return bResult; +} + bool isDocumentGeneratedWithOpenOfficeOlderThan3_0( const uno::Reference< frame::XModel >& xChartModel ) { bool bResult = isDocumentGeneratedWithOpenOfficeOlderThan2_3( xChartModel ); diff --git a/xmloff/source/chart/SchXMLTools.hxx b/xmloff/source/chart/SchXMLTools.hxx index 35ac3ff72f1b..4912eb5d286e 100644 --- a/xmloff/source/chart/SchXMLTools.hxx +++ b/xmloff/source/chart/SchXMLTools.hxx @@ -54,6 +54,7 @@ namespace SchXMLTools bool isDocumentGeneratedWithOpenOfficeOlderThan2_3( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel); bool isDocumentGeneratedWithOpenOfficeOlderThan2_4( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel); bool isDocumentGeneratedWithOpenOfficeOlderThan3_0( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel); + bool isDocumentGeneratedWithOpenOfficeOlderThan3_4( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel); void setBuildIDAtImportInfo( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > xModel , ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xImportInfo ); -- cgit From f549461066693eb19fdf8bbb4139bcb5e70eca77 Mon Sep 17 00:00:00 2001 From: Ingrid Halama Date: Wed, 31 Mar 2010 20:07:14 +0200 Subject: chartpositioning: #i100778# fixed typo --- xmloff/source/chart/SchXMLPlotAreaContext.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xmloff/source') diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx index 3621789099b6..8f0767c3b6b9 100644 --- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx +++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx @@ -704,7 +704,7 @@ void SchXMLPlotAreaContext::EndElement() else if( bOuterSize ) { if( SchXMLTools::isDocumentGeneratedWithOpenOfficeOlderThan3_4( GetImport().GetModel() ) ) //old version of OOo did write a wrong rectangle for the diagram size - xDiaPos->setDiagramPositionIncludingAxesAndAxesTitles( m_aOuterPositioning.getRectangle() ); + xDiaPos->setDiagramPositionIncludingAxesAndAxisTitles( m_aOuterPositioning.getRectangle() ); else xDiaPos->setDiagramPositionIncludingAxes( m_aOuterPositioning.getRectangle() ); } -- cgit From 5b0fcb960d8b6d49faf40a442b69036bd8efa688 Mon Sep 17 00:00:00 2001 From: Ingrid Halama Date: Thu, 1 Apr 2010 20:29:01 +0200 Subject: chartpositioning: #i100778# correct ODF behaviour --- xmloff/source/chart/SchXMLExport.cxx | 12 ++++++++++-- xmloff/source/chart/SchXMLImport.cxx | 3 +++ xmloff/source/chart/SchXMLPlotAreaContext.cxx | 16 +++++----------- xmloff/source/chart/SchXMLTools.cxx | 4 +--- xmloff/source/chart/SchXMLTools.hxx | 2 +- xmloff/source/core/xmltoken.cxx | 2 ++ 6 files changed, 22 insertions(+), 17 deletions(-) (limited to 'xmloff/source') diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index 51541c6df637..cc281c165cb3 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -2085,6 +2085,12 @@ void SchXMLExportHelper_Impl::exportPlotArea( void SchXMLExportHelper_Impl::exportExcludingPosition( 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 + return; + Reference< chart::XDiagramPositioning > xDiaPos( xDiagram, uno::UNO_QUERY ); DBG_ASSERT( xDiaPos.is(), "Invalid xDiaPos as parameter" ); if( !xDiaPos.is() ) @@ -2098,9 +2104,9 @@ void SchXMLExportHelper_Impl::exportExcludingPosition( const uno::Reference< cha rtl::OUStringBuffer sStringBuffer; SvXMLUnitConverter::convertBool( sStringBuffer, bPreferExcludingPositioning ); String aString( sStringBuffer.makeStringAndClear() ); - mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_PREFER_EXCLUDING_POSITION, aString ); + mrExport.AddAttribute( XML_NAMESPACE_CHART_EXT, XML_PREFER_EXCLUDING_POSITION, aString );//todo: change to chart namespace in future - dependent on fileformat - SvXMLElementExport aExcludingPosition( mrExport, XML_NAMESPACE_CHART, XML_EXCLUDING_POSITION, sal_True, sal_True ); + SvXMLElementExport aExcludingPosition( mrExport, XML_NAMESPACE_CHART_EXT, XML_EXCLUDING_POSITION, sal_True, sal_True );//todo: change to chart namespace in future - dependent on fileformat } void SchXMLExportHelper_Impl::exportAxes( @@ -3646,6 +3652,8 @@ SchXMLExport::SchXMLExport( maAutoStylePool( *this ), maExportHelper( *this, maAutoStylePool ) { + if( getDefaultVersion() == SvtSaveOptions::ODFVER_LATEST ) + _GetNamespaceMap().Add( GetXMLToken(XML_NP_CHART_EXT), GetXMLToken(XML_N_CHART_EXT), XML_NAMESPACE_CHART_EXT); } diff --git a/xmloff/source/chart/SchXMLImport.cxx b/xmloff/source/chart/SchXMLImport.cxx index 2fc23926ef1e..501f92953663 100644 --- a/xmloff/source/chart/SchXMLImport.cxx +++ b/xmloff/source/chart/SchXMLImport.cxx @@ -281,6 +281,7 @@ const SvXMLTokenMap& SchXMLImportHelper::GetPlotAreaElemTokenMap() { static __FAR_DATA SvXMLTokenMapEntry aPlotAreaElemTokenMap[] = { + { XML_NAMESPACE_CHART_EXT, XML_EXCLUDING_POSITION, XML_TOK_PA_EXCLUDING_POSITION_EXT }, { XML_NAMESPACE_CHART, XML_EXCLUDING_POSITION, XML_TOK_PA_EXCLUDING_POSITION }, { XML_NAMESPACE_CHART, XML_AXIS, XML_TOK_PA_AXIS }, { XML_NAMESPACE_CHART, XML_SERIES, XML_TOK_PA_SERIES }, @@ -658,6 +659,7 @@ SchXMLImport::SchXMLImport( SvXMLImport( xServiceFactory, nImportFlags ) { GetNamespaceMap().Add( GetXMLToken(XML_NP_XLINK), GetXMLToken(XML_N_XLINK), XML_NAMESPACE_XLINK ); + GetNamespaceMap().Add( GetXMLToken(XML_NP_CHART_EXT), GetXMLToken(XML_N_CHART_EXT), XML_NAMESPACE_CHART_EXT); mbIsGraphicLoadOnDemandSupported = false; } @@ -671,6 +673,7 @@ SchXMLImport::SchXMLImport( : SvXMLImport( xServiceFactory, xModel, rGrfContainer ) { GetNamespaceMap().Add( GetXMLToken(XML_NP_XLINK), GetXMLToken(XML_N_XLINK), XML_NAMESPACE_XLINK ); + GetNamespaceMap().Add( GetXMLToken(XML_NP_CHART_EXT), GetXMLToken(XML_N_CHART_EXT), XML_NAMESPACE_CHART_EXT); // get status indicator (if requested) if( bShowProgress ) diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx index 8f0767c3b6b9..3792deefebbd 100644 --- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx +++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx @@ -520,6 +520,7 @@ SvXMLImportContext* SchXMLPlotAreaContext::CreateChildContext( switch( rTokenMap.Get( nPrefix, rLocalName )) { + case XML_TOK_PA_EXCLUDING_POSITION_EXT: case XML_TOK_PA_EXCLUDING_POSITION: { pContext = new SchXMLExcludingPositionContext( GetImport(), nPrefix, rLocalName, m_aInnerPositioning ); @@ -703,7 +704,7 @@ void SchXMLPlotAreaContext::EndElement() } else if( bOuterSize ) { - if( SchXMLTools::isDocumentGeneratedWithOpenOfficeOlderThan3_4( GetImport().GetModel() ) ) //old version of OOo did write a wrong rectangle for the diagram size + 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() ); @@ -1743,18 +1744,11 @@ bool SchXMLPositonAttributesHelper::readPositioningAttribute( sal_uInt16 nPrefix else bReturn = false; } - else if( XML_NAMESPACE_CHART == nPrefix ) + else if( IsXMLToken( rLocalName, XML_PREFER_EXCLUDING_POSITION ) ) { - //Attribute( XML_NAMESPACE_CHART, XML_PREFER_EXCLUDING_POSITION - sal_Bool bPreferExcludingPosition = false; - if( IsXMLToken( rLocalName, XML_PREFER_EXCLUDING_POSITION ) ) - { - m_rImport.GetMM100UnitConverter().convertBool( bPreferExcludingPosition, rValue ); - m_bAutoPosition = m_bAutoSize = !bPreferExcludingPosition; - } - else - bReturn = false; + m_rImport.GetMM100UnitConverter().convertBool( bPreferExcludingPosition, rValue ); + m_bAutoPosition = m_bAutoSize = !bPreferExcludingPosition; } else bReturn = false; diff --git a/xmloff/source/chart/SchXMLTools.cxx b/xmloff/source/chart/SchXMLTools.cxx index f836f1c1de7c..c6fb4d0ca013 100644 --- a/xmloff/source/chart/SchXMLTools.cxx +++ b/xmloff/source/chart/SchXMLTools.cxx @@ -705,7 +705,7 @@ void setBuildIDAtImportInfo( uno::Reference< frame::XModel > xModel, Reference< SvXMLMetaDocumentContext::setBuildId( aGenerator, xImportInfo ); } -bool isDocumentGeneratedWithOpenOfficeOlderThan3_4( const uno::Reference< frame::XModel >& xChartModel ) +bool isDocumentGeneratedWithOpenOfficeOlderThan3_3( const uno::Reference< frame::XModel >& xChartModel ) { bool bResult = isDocumentGeneratedWithOpenOfficeOlderThan3_0( xChartModel ); if( !bResult ) @@ -719,8 +719,6 @@ bool isDocumentGeneratedWithOpenOfficeOlderThan3_4( const uno::Reference< frame: bResult= true; else if( aGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OpenOffice.org_project/320m") ) ) != -1 ) bResult= true; - else if( aGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OpenOffice.org_project/330m") ) ) != -1 ) - bResult= true; } } return bResult; diff --git a/xmloff/source/chart/SchXMLTools.hxx b/xmloff/source/chart/SchXMLTools.hxx index 4912eb5d286e..382e6c5cc16f 100644 --- a/xmloff/source/chart/SchXMLTools.hxx +++ b/xmloff/source/chart/SchXMLTools.hxx @@ -54,7 +54,7 @@ namespace SchXMLTools bool isDocumentGeneratedWithOpenOfficeOlderThan2_3( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel); bool isDocumentGeneratedWithOpenOfficeOlderThan2_4( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel); bool isDocumentGeneratedWithOpenOfficeOlderThan3_0( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel); - bool isDocumentGeneratedWithOpenOfficeOlderThan3_4( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel); + bool isDocumentGeneratedWithOpenOfficeOlderThan3_3( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel); void setBuildIDAtImportInfo( ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > xModel , ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xImportInfo ); diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx index 7ea75b1868d3..2fb65535964c 100644 --- a/xmloff/source/core/xmltoken.cxx +++ b/xmloff/source/core/xmltoken.cxx @@ -3096,6 +3096,8 @@ namespace xmloff { namespace token { TOKEN( "ends-with", XML_ENDS_WITH ), TOKEN( "does-not-end-with", XML_DOES_NOT_END_WITH ), + TOKEN( "chartooo", XML_NP_CHART_EXT ), + TOKEN( "http://openoffice.org/2010/chart", XML_N_CHART_EXT ), TOKEN( "excluding-position", XML_EXCLUDING_POSITION ), TOKEN( "prefer-excluding-position", XML_PREFER_EXCLUDING_POSITION ), -- cgit From 21cf3286fe2d239cc8697258b1af4e7294cc6607 Mon Sep 17 00:00:00 2001 From: Ingrid Halama Date: Tue, 6 Apr 2010 11:47:20 +0200 Subject: chartpositioning: #i100778# correct ODF behaviour --- xmloff/source/chart/SchXMLTools.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'xmloff/source') diff --git a/xmloff/source/chart/SchXMLTools.cxx b/xmloff/source/chart/SchXMLTools.cxx index c6fb4d0ca013..4456fbec7cb1 100644 --- a/xmloff/source/chart/SchXMLTools.cxx +++ b/xmloff/source/chart/SchXMLTools.cxx @@ -714,7 +714,11 @@ bool isDocumentGeneratedWithOpenOfficeOlderThan3_3( const uno::Reference< frame: if( aGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OpenOffice.org_project/3") ) ) != -1 ) { if( aGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OpenOffice.org_project/300m") ) ) != -1 ) - bResult= true; + { + sal_Int32 nBuilId = lcl_getBuildIDFromGenerator( lcl_getGeneratorFromModel(xChartModel) ); + if( nBuilId>0 && nBuilId<9488 ) //9488 is build id of dev300m75 + bResult= true; + } else if( aGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OpenOffice.org_project/310m") ) ) != -1 ) bResult= true; else if( aGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OpenOffice.org_project/320m") ) ) != -1 ) -- cgit From 838c91c229efff4a846fb8d6efd0211b999adf56 Mon Sep 17 00:00:00 2001 From: Ingrid Halama Date: Wed, 14 Apr 2010 12:21:27 +0200 Subject: chartpositioning: #i100778# correct ODF behaviour --- xmloff/source/chart/SchXMLExport.cxx | 4 ++-- xmloff/source/chart/SchXMLImport.cxx | 4 ++-- xmloff/source/chart/SchXMLPlotAreaContext.cxx | 6 +++--- xmloff/source/chart/SchXMLTools.cxx | 2 +- xmloff/source/core/xmltoken.cxx | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) (limited to 'xmloff/source') diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index cc281c165cb3..9f0653cd44d9 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -2104,9 +2104,9 @@ void SchXMLExportHelper_Impl::exportExcludingPosition( const uno::Reference< cha rtl::OUStringBuffer sStringBuffer; SvXMLUnitConverter::convertBool( sStringBuffer, bPreferExcludingPositioning ); String aString( sStringBuffer.makeStringAndClear() ); - mrExport.AddAttribute( XML_NAMESPACE_CHART_EXT, XML_PREFER_EXCLUDING_POSITION, aString );//todo: change to chart namespace in future - dependent on fileformat + 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_EXCLUDING_POSITION, sal_True, sal_True );//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 } void SchXMLExportHelper_Impl::exportAxes( diff --git a/xmloff/source/chart/SchXMLImport.cxx b/xmloff/source/chart/SchXMLImport.cxx index 501f92953663..587070202c9c 100644 --- a/xmloff/source/chart/SchXMLImport.cxx +++ b/xmloff/source/chart/SchXMLImport.cxx @@ -281,8 +281,8 @@ const SvXMLTokenMap& SchXMLImportHelper::GetPlotAreaElemTokenMap() { static __FAR_DATA SvXMLTokenMapEntry aPlotAreaElemTokenMap[] = { - { XML_NAMESPACE_CHART_EXT, XML_EXCLUDING_POSITION, XML_TOK_PA_EXCLUDING_POSITION_EXT }, - { XML_NAMESPACE_CHART, XML_EXCLUDING_POSITION, XML_TOK_PA_EXCLUDING_POSITION }, + { XML_NAMESPACE_CHART_EXT, XML_COORDINATE_REGION, XML_TOK_PA_COORDINATE_REGION_EXT }, + { XML_NAMESPACE_CHART, XML_COORDINATE_REGION, XML_TOK_PA_COORDINATE_REGION }, { XML_NAMESPACE_CHART, XML_AXIS, XML_TOK_PA_AXIS }, { XML_NAMESPACE_CHART, XML_SERIES, XML_TOK_PA_SERIES }, { XML_NAMESPACE_CHART, XML_WALL, XML_TOK_PA_WALL }, diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx index 3792deefebbd..75fc4b2b5cdb 100644 --- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx +++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx @@ -520,8 +520,8 @@ SvXMLImportContext* SchXMLPlotAreaContext::CreateChildContext( switch( rTokenMap.Get( nPrefix, rLocalName )) { - case XML_TOK_PA_EXCLUDING_POSITION_EXT: - case XML_TOK_PA_EXCLUDING_POSITION: + case XML_TOK_PA_COORDINATE_REGION_EXT: + case XML_TOK_PA_COORDINATE_REGION: { pContext = new SchXMLExcludingPositionContext( GetImport(), nPrefix, rLocalName, m_aInnerPositioning ); } @@ -1744,7 +1744,7 @@ bool SchXMLPositonAttributesHelper::readPositioningAttribute( sal_uInt16 nPrefix else bReturn = false; } - else if( IsXMLToken( rLocalName, XML_PREFER_EXCLUDING_POSITION ) ) + else if( IsXMLToken( rLocalName, XML_PREFER_COORDINATE_REGION ) ) { sal_Bool bPreferExcludingPosition = false; m_rImport.GetMM100UnitConverter().convertBool( bPreferExcludingPosition, rValue ); diff --git a/xmloff/source/chart/SchXMLTools.cxx b/xmloff/source/chart/SchXMLTools.cxx index 4456fbec7cb1..f6e33a946acd 100644 --- a/xmloff/source/chart/SchXMLTools.cxx +++ b/xmloff/source/chart/SchXMLTools.cxx @@ -716,7 +716,7 @@ bool isDocumentGeneratedWithOpenOfficeOlderThan3_3( const uno::Reference< frame: if( aGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OpenOffice.org_project/300m") ) ) != -1 ) { sal_Int32 nBuilId = lcl_getBuildIDFromGenerator( lcl_getGeneratorFromModel(xChartModel) ); - if( nBuilId>0 && nBuilId<9488 ) //9488 is build id of dev300m75 + if( nBuilId>0 && nBuilId<9491 ) //9491 is build id of dev300m76 bResult= true; } else if( aGenerator.indexOf( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("OpenOffice.org_project/310m") ) ) != -1 ) diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx index 2fb65535964c..2ee9176bb080 100644 --- a/xmloff/source/core/xmltoken.cxx +++ b/xmloff/source/core/xmltoken.cxx @@ -3098,8 +3098,8 @@ namespace xmloff { namespace token { TOKEN( "chartooo", XML_NP_CHART_EXT ), TOKEN( "http://openoffice.org/2010/chart", XML_N_CHART_EXT ), - TOKEN( "excluding-position", XML_EXCLUDING_POSITION ), - TOKEN( "prefer-excluding-position", XML_PREFER_EXCLUDING_POSITION ), + 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 } -- cgit From e5fca8fd92fed0b7b719645c461ffe89401ff62a Mon Sep 17 00:00:00 2001 From: Ingrid Halama Date: Wed, 5 May 2010 18:16:33 +0200 Subject: chartpositioning: #i100778# simplify user interface: reduce sizing options to new excluding mode only --- xmloff/source/chart/SchXMLExport.cxx | 16 ++++-------- xmloff/source/chart/SchXMLPlotAreaContext.cxx | 35 ++++++++++----------------- xmloff/source/chart/SchXMLPlotAreaContext.hxx | 6 ++--- xmloff/source/core/xmltoken.cxx | 1 - 4 files changed, 21 insertions(+), 37 deletions(-) (limited to 'xmloff/source') 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 } -- cgit From 3bf9010a46b16a7927ccf20537157387e79f8565 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Mon, 10 May 2010 18:54:44 +0200 Subject: sw33bf04: #i111381#: OValuePropertiesMetaData: apply patch by tono --- xmloff/source/forms/valueproperties.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xmloff/source') diff --git a/xmloff/source/forms/valueproperties.cxx b/xmloff/source/forms/valueproperties.cxx index 3515dcf96010..1c44db963944 100644 --- a/xmloff/source/forms/valueproperties.cxx +++ b/xmloff/source/forms/valueproperties.cxx @@ -116,7 +116,7 @@ namespace xmloff void OValuePropertiesMetaData::getValueLimitPropertyNames(sal_Int16 _nFormComponentType, sal_Char const * & _rpMinValuePropertyName, sal_Char const * & _rpMaxValuePropertyName) { - _rpMinValuePropertyName = _rpMinValuePropertyName = NULL; + _rpMinValuePropertyName = _rpMaxValuePropertyName = NULL; switch (_nFormComponentType) { case FormComponentType::DATEFIELD: -- cgit From 6785f857f4956c6dfd155074c92fe985c05d5835 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Fri, 4 Jun 2010 10:43:31 +0200 Subject: masterfix: #i10000# #i112082# load/store issue --- xmloff/source/forms/elementexport.cxx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'xmloff/source') diff --git a/xmloff/source/forms/elementexport.cxx b/xmloff/source/forms/elementexport.cxx index 88abf8ad988a..115b06c4c2ad 100644 --- a/xmloff/source/forms/elementexport.cxx +++ b/xmloff/source/forms/elementexport.cxx @@ -2034,10 +2034,7 @@ namespace xmloff OAttributeMetaData::getFormAttributeName(eStringPropertyIds[i]), aStringPropertyNames[i]); - // Since as per ODF 1.2, xlink:href and xlink:type need to exist either both or none, - // we need to write xlink:type, too, even if it carries no information. - // #i111035# / 2010-04-141/ frank.schoenheit@sun.com - AddAttributeASCII( XML_NAMESPACE_XLINK, "type", "simple" ); + // #i112082# xlink:type is added as part of exportTargetLocationAttribute // now export the data source name or databaselocation or connection resource ::rtl::OUString sPropValue; -- cgit From e03596eaf693b9809cffe86c21658a5ce381d6c3 Mon Sep 17 00:00:00 2001 From: Ruediger Timm Date: Mon, 7 Jun 2010 16:20:49 +0200 Subject: masterfix #i112192#: buildbreaker in xmloff/source/text/XMLSectionExport.cxx on product debug --- xmloff/source/text/XMLSectionExport.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xmloff/source') diff --git a/xmloff/source/text/XMLSectionExport.cxx b/xmloff/source/text/XMLSectionExport.cxx index 0a0437426a3c..7cf96abea2e2 100644 --- a/xmloff/source/text/XMLSectionExport.cxx +++ b/xmloff/source/text/XMLSectionExport.cxx @@ -917,7 +917,7 @@ void XMLSectionExport::ExportBaseIndexSource( void XMLSectionExport::ExportBaseIndexBody( SectionTypeEnum - #ifdef DBG_UTIL + #if OSL_DEBUG_LEVEL > 0 eType #endif , -- cgit