summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIngrid Halama <iha@openoffice.org>2010-05-05 18:16:33 +0200
committerIngrid Halama <iha@openoffice.org>2010-05-05 18:16:33 +0200
commitb0fc9353e70516dccadc4bff5914775eaaa269b9 (patch)
treeaa9ae8a3cd15c56cdcbad235a2556e0f17f1b01b
parent4a19e21c6d9d37dc7f815e82d899a66e2fef14c8 (diff)
chartpositioning: #i100778# simplify user interface: reduce sizing options to new excluding mode only
-rw-r--r--xmloff/inc/xmloff/xmltoken.hxx1
-rw-r--r--xmloff/source/chart/SchXMLExport.cxx16
-rw-r--r--xmloff/source/chart/SchXMLPlotAreaContext.cxx35
-rw-r--r--xmloff/source/chart/SchXMLPlotAreaContext.hxx6
-rw-r--r--xmloff/source/core/xmltoken.cxx1
5 files changed, 21 insertions, 38 deletions
diff --git a/xmloff/inc/xmloff/xmltoken.hxx b/xmloff/inc/xmloff/xmltoken.hxx
index ad423688fe..b80b4b2e0c 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 5b7e94445b..659f675adc 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 );
@@ -2099,14 +2099,8 @@ void SchXMLExportHelper_Impl::exportExcludingPosition( const uno::Reference< cha
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_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 85336c117a..4face53b8b 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 5366b0a474..c7e55f9571 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 37f3b65b6d..d18b7c550a 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 }