summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Milcke <bm@openoffice.org>2001-03-29 10:08:57 +0000
committerBjörn Milcke <bm@openoffice.org>2001-03-29 10:08:57 +0000
commit8ba544319dd414d7fe5dad5e5dcb0aef527ba50f (patch)
treeec894cc854d001a88e36804946e0ab5c57651e9f
parent4c42fb4a32b97c2f6d18fb25805867d85b1f44bf (diff)
#82030# Set Legend position only if there is a legend
-rw-r--r--xmloff/source/chart/SchXMLChartContext.cxx15
-rw-r--r--xmloff/source/chart/SchXMLChartContext.hxx5
2 files changed, 14 insertions, 6 deletions
diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx
index 36a56c6353e6..747f04603a38 100644
--- a/xmloff/source/chart/SchXMLChartContext.cxx
+++ b/xmloff/source/chart/SchXMLChartContext.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: SchXMLChartContext.cxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: bm $ $Date: 2001-03-27 13:22:50 $
+ * last change: $Author: bm $ $Date: 2001-03-29 11:08:44 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -167,7 +167,8 @@ SchXMLChartContext::SchXMLChartContext( SchXMLImportHelper& rImpHelper,
SvXMLImport& rImport, const rtl::OUString& rLocalName ) :
SvXMLImportContext( rImport, XML_NAMESPACE_CHART, rLocalName ),
mrImportHelper( rImpHelper ),
- mbHasOwnTable( sal_False )
+ mbHasOwnTable( sal_False ),
+ mbHasLegend( sal_False )
{
// hide title, subtitle and legend
uno::Reference< beans::XPropertySet > xProp( mrImportHelper.GetChartDocument(), uno::UNO_QUERY );
@@ -507,7 +508,7 @@ void SchXMLChartContext::EndElement()
xModel->unlockControllers();
// set absolute legend position after (BuildChart!)
- if( maLegendPos.X != -1 )
+ if( mbHasLegend )
{
uno::Reference< drawing::XShape > xLegendShape( xDoc->getLegend(), uno::UNO_QUERY );
if( xLegendShape.is())
@@ -568,6 +569,7 @@ SvXMLImportContext* SchXMLChartContext::CreateChildContext(
case XML_TOK_CHART_LEGEND:
pContext = new SchXMLLegendContext( mrImportHelper, GetImport(), rLocalName, maLegendPos );
+ mbHasLegend =sal_True;
break;
case XML_TOK_CHART_TABLE:
@@ -693,6 +695,11 @@ void SchXMLLegendContext::StartElement( const uno::Reference< xml::sax::XAttribu
{
xDocProp->setPropertyValue( rtl::OUString::createFromAscii( "HasLegend" ), aTrueBool );
SCH_BUILDCHART( xDoc );
+
+ // initialize position
+ uno::Reference< drawing::XShape > xLegendShape( xDoc->getLegend(), uno::UNO_QUERY );
+ if( xLegendShape.is())
+ mrPosition = xLegendShape->getPosition();
}
catch( beans::UnknownPropertyException )
{
diff --git a/xmloff/source/chart/SchXMLChartContext.hxx b/xmloff/source/chart/SchXMLChartContext.hxx
index 389b3b5c8054..1fc3404f8f6c 100644
--- a/xmloff/source/chart/SchXMLChartContext.hxx
+++ b/xmloff/source/chart/SchXMLChartContext.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: SchXMLChartContext.hxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: bm $ $Date: 2001-03-27 13:23:22 $
+ * last change: $Author: bm $ $Date: 2001-03-29 11:08:57 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -100,6 +100,7 @@ private:
rtl::OUString maMainTitle, maSubTitle;
com::sun::star::awt::Point maMainTitlePos, maSubTitlePos, maLegendPos;
sal_Bool mbHasOwnTable;
+ sal_Bool mbHasLegend;
com::sun::star::uno::Sequence< com::sun::star::chart::ChartSeriesAddress > maSeriesAddresses;
rtl::OUString msCategoriesAddress;