summaryrefslogtreecommitdiffstats
path: root/oox
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2012-09-06 18:36:00 +0100
committerNoel Power <noel.power@suse.com>2012-09-11 16:04:11 +0100
commit27a19817c6271b76013aa6bda5c3353c8a9dd35b (patch)
tree75c939b2695447a0915706a508a979f73865f1d2 /oox
parentadd persistence support for the scrollable attributes (diff)
downloadcore-27a19817c6271b76013aa6bda5c3353c8a9dd35b.tar.gz
core-27a19817c6271b76013aa6bda5c3353c8a9dd35b.zip
some more tweaking to import scrollbar data for mso Frame & Userform
also removed printf(s) Change-Id: If83565dcd97b276e1f6a8488a9f1d23066c2a9ff
Diffstat (limited to 'oox')
-rw-r--r--oox/inc/oox/ole/axcontrol.hxx6
-rw-r--r--oox/source/ole/axcontrol.cxx16
-rw-r--r--oox/source/token/properties.txt4
3 files changed, 26 insertions, 0 deletions
diff --git a/oox/inc/oox/ole/axcontrol.hxx b/oox/inc/oox/ole/axcontrol.hxx
index c41e7642b9c5..285cb74f0e77 100644
--- a/oox/inc/oox/ole/axcontrol.hxx
+++ b/oox/inc/oox/ole/axcontrol.hxx
@@ -249,6 +249,12 @@ public:
sal_Int32 nMin, sal_Int32 nMax, sal_Int32 nPosition,
sal_Int32 nSmallChange, sal_Int32 nLargeChange, bool bAwtModel ) const;
+ /** Converts scrollability settings to UNO properties. */
+ void convertScrollabilitySettings(
+ PropertyMap& rPropMap,
+ const AxPairData& rScrollPos, const AxPairData& rScrollArea,
+ sal_Int32 nScrollBars ) const;
+
/** Binds the passed control model to the passed data sources. The
implementation will check which source types are supported. */
void bindToSources(
diff --git a/oox/source/ole/axcontrol.cxx b/oox/source/ole/axcontrol.cxx
index d776893e5842..89570b933a0e 100644
--- a/oox/source/ole/axcontrol.cxx
+++ b/oox/source/ole/axcontrol.cxx
@@ -316,6 +316,20 @@ void ControlConverter::convertVerticalAlign( PropertyMap& rPropMap, sal_Int32 nV
rPropMap.setProperty( PROP_VerticalAlign, eAlign );
}
+void ControlConverter::convertScrollabilitySettings( PropertyMap& rPropMap,
+ const AxPairData& rScrollPos, const AxPairData& rScrollArea,
+ sal_Int32 nScrollBars ) const
+{
+ Size tmpSize = mrGraphicHelper.convertHmmToAppFont( Size( rScrollArea.first, rScrollArea.second ) );
+ Point tmpPos = mrGraphicHelper.convertHmmToAppFont( Point( rScrollPos.first, rScrollPos.second ) );
+ rPropMap.setProperty( PROP_ScrollHeight, tmpSize.Height );
+ rPropMap.setProperty( PROP_ScrollWidth, tmpSize.Width );
+ rPropMap.setProperty( PROP_ScrollTop, tmpPos.Y );
+ rPropMap.setProperty( PROP_ScrollLeft, tmpPos.X );
+ rPropMap.setProperty( PROP_HScroll, ( nScrollBars & 0x1 ) == 0x1 );
+ rPropMap.setProperty( PROP_VScroll, ( nScrollBars & 0x2 ) == 0x2 );
+}
+
void ControlConverter::convertScrollBar( PropertyMap& rPropMap,
sal_Int32 nMin, sal_Int32 nMax, sal_Int32 nPosition,
sal_Int32 nSmallChange, sal_Int32 nLargeChange, bool bAwtModel ) const
@@ -2431,6 +2445,7 @@ void AxFrameModel::convertProperties( PropertyMap& rPropMap, const ControlConver
{
rPropMap.setProperty( PROP_Label, maCaption );
rPropMap.setProperty( PROP_Enabled, getFlag( mnFlags, AX_CONTAINER_ENABLED ) );
+ rConv.convertScrollabilitySettings( rPropMap, maScrollPos, maLogicalSize, mnScrollBars );
AxContainerModelBase::convertProperties( rPropMap, rConv );
}
@@ -2493,6 +2508,7 @@ void AxUserFormModel::convertProperties( PropertyMap& rPropMap, const ControlCon
rPropMap.setProperty( PROP_Title, maCaption );
rConv.convertColor( rPropMap, PROP_BackgroundColor, mnBackColor );
rConv.convertAxPicture( rPropMap, maPictureData, AX_PICPOS_CENTER );
+ rConv.convertScrollabilitySettings( rPropMap, maScrollPos, maLogicalSize, mnScrollBars );
AxContainerModelBase::convertProperties( rPropMap, rConv );
}
diff --git a/oox/source/token/properties.txt b/oox/source/token/properties.txt
index 596bf826bba3..5c917e9d7f29 100644
--- a/oox/source/token/properties.txt
+++ b/oox/source/token/properties.txt
@@ -394,9 +394,13 @@ ScaleMode
ScaleToPages
ScaleToPagesX
ScaleToPagesY
+ScrollHeight
+ScrollLeft
+ScrollTop
ScrollValue
ScrollValueMax
ScrollValueMin
+ScrollWidth
Segments
SelectedItems
SelectedPage