summaryrefslogtreecommitdiff
path: root/oox/source/xls/drawingbase.cxx
diff options
context:
space:
mode:
authorNoel Power <noel.power@novell.com>2012-01-26 11:00:15 +0000
committerNoel Power <noel.power@novell.com>2012-02-03 12:43:42 +0000
commitc07e9299bb2c8d5477669568b12708bd2ff12684 (patch)
treead4de6430ced620df45523fdea71e1c818192e80 /oox/source/xls/drawingbase.cxx
parent3364fcc5a550fae001b24f4303a978662bb7c70f (diff)
improve xlsx shape/chart import, anchor to cell where needed fdo#45266
Diffstat (limited to 'oox/source/xls/drawingbase.cxx')
-rw-r--r--oox/source/xls/drawingbase.cxx30
1 files changed, 30 insertions, 0 deletions
diff --git a/oox/source/xls/drawingbase.cxx b/oox/source/xls/drawingbase.cxx
index 3369ba9f7e65..91ed337334b8 100644
--- a/oox/source/xls/drawingbase.cxx
+++ b/oox/source/xls/drawingbase.cxx
@@ -32,6 +32,7 @@
#include "oox/helper/attributelist.hxx"
#include "oox/helper/binaryinputstream.hxx"
#include "oox/xls/unitconverter.hxx"
+#include "oox/helper/propertyset.hxx"
namespace oox {
namespace xls {
@@ -281,6 +282,35 @@ Rectangle ShapeAnchor::calcAnchorRectHmm( const Size& rPageSizeHmm ) const
return Rectangle( lclEmuToHmm( aAnchorRect.X ), lclEmuToHmm( aAnchorRect.Y ), lclEmuToHmm( aAnchorRect.Width ), lclEmuToHmm( aAnchorRect.Height ) );
}
+::com::sun::star::uno::Reference< ::com::sun::star::table::XCell >
+ShapeAnchor::getToCell() const
+{
+ CellAddress aAddress;
+ aAddress.Sheet = getSheetIndex();
+ aAddress.Row = maTo.mnRow;
+ aAddress.Column = maTo.mnCol;
+ return getCell( aAddress );
+}
+::com::sun::star::uno::Reference< ::com::sun::star::table::XCell >
+ShapeAnchor::getFromCell() const
+{
+ CellAddress aAddress;
+ aAddress.Sheet = getSheetIndex();
+ aAddress.Row = maFrom.mnRow;
+ aAddress.Column = maFrom.mnCol;
+ return getCell( aAddress );
+}
+
+void
+ShapeAnchor::applyToXShape( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape>& rxShape )
+{
+ if ( ( meAnchorType == ANCHOR_TWOCELL || meAnchorType == ANCHOR_ONECELL ) && getFromCell().is() )
+ {
+ PropertySet aShapeProp( rxShape );
+ aShapeProp.setProperty( PROP_Anchor, getFromCell() );
+ }
+}
+
// private --------------------------------------------------------------------
EmuPoint ShapeAnchor::calcCellAnchorEmu( const CellAnchorModel& rModel ) const