diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2009-01-06 16:42:28 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2009-01-06 16:42:28 +0000 |
commit | 25913c730f07766457d08f24008cbfb97f0a60a3 (patch) | |
tree | acdcd858cd19f68597bdc872a4355dd3c335e7b1 /sw/source/ui/uno | |
parent | 05342c68cbfedb1cc4f9832592fa277d30832162 (diff) |
CWS-TOOLING: integrate CWS os123
2008-12-10 10:15:09 +0100 os r265154 : #i94987# DateTimeValue added
2008-12-10 09:00:58 +0100 os r265150 : #i96045# ctl languages enabled
2008-12-09 18:09:10 +0100 os r265129 : syntax error fixed
2008-12-09 09:35:09 +0100 os r265056 : vertical/horizonatal metric: no bool value
2008-12-08 09:56:50 +0100 os r264974 : CWS-TOOLING: rebase CWS os123 to trunk@264807 (milestone: DEV300:m37)
2008-12-03 11:41:13 +0100 os r264762 : #i96822# database removed, too
2008-12-03 11:35:26 +0100 os r264760 : #i96822# business cards and labels should not be part of the document list
2008-12-01 11:38:26 +0100 os r264592 : #i96322# command name of ActivateStyleApply added
2008-11-27 14:59:46 +0100 va r264491 : #i95322#: Initial Revision
2008-11-27 14:53:20 +0100 va r264490 : #i95322#: New Language Directory for Persian (Farsi)
2008-11-21 08:48:55 +0100 os r264107 : #i94409# recording/executing split table
2008-11-13 13:18:57 +0100 os r263636 : #i93924# string reconversion
2008-11-12 15:58:48 +0100 os r263604 : #i94987# Date property re-add to Annotation service
2008-11-12 15:44:24 +0100 os r263603 : #i88766# ruler metric
2008-11-12 15:43:33 +0100 os r263602 : #i88766#
2008-11-11 09:15:28 +0100 os r263545 : #i94839# get real filter name from dialog instead of guessing from UI name
Diffstat (limited to 'sw/source/ui/uno')
-rw-r--r-- | sw/source/ui/uno/unomod.cxx | 94 |
1 files changed, 90 insertions, 4 deletions
diff --git a/sw/source/ui/uno/unomod.cxx b/sw/source/ui/uno/unomod.cxx index 5338679e6a16..57a2a8ec6c1f 100644 --- a/sw/source/ui/uno/unomod.cxx +++ b/sw/source/ui/uno/unomod.cxx @@ -105,7 +105,9 @@ enum SwViewSettingsPropertyHandles HANDLE_VIEWSET_RASTER_RESOLUTION_X, HANDLE_VIEWSET_RASTER_RESOLUTION_Y, HANDLE_VIEWSET_RASTER_SUBDIVISION_X, - HANDLE_VIEWSET_RASTER_SUBDIVISION_Y + HANDLE_VIEWSET_RASTER_SUBDIVISION_Y, + HANDLE_VIEWSET_HORI_RULER_METRIC, + HANDLE_VIEWSET_VERT_RULER_METRIC }; enum SwPrintSettingsPropertyHandles { @@ -131,6 +133,7 @@ static ChainablePropertySetInfo * lcl_createViewSettingsInfo() static PropertyInfo aViewSettingsMap_Impl[] = { { RTL_CONSTASCII_STRINGPARAM ( "HelpURL" ), HANDLE_VIEWSET_HELP_URL , CPPUTYPE_OUSTRING, PROPERTY_NONE, 0}, + { RTL_CONSTASCII_STRINGPARAM ( "HorizontalRulerMetric"),HANDLE_VIEWSET_HORI_RULER_METRIC , CPPUTYPE_INT32, PROPERTY_NONE, 0}, { RTL_CONSTASCII_STRINGPARAM ( "IsRasterVisible"), HANDLE_VIEWSET_IS_RASTER_VISIBLE, CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, { RTL_CONSTASCII_STRINGPARAM ( "IsSnapToRaster"), HANDLE_VIEWSET_IS_SNAP_TO_RASTER, CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, { RTL_CONSTASCII_STRINGPARAM ( "IsVertRulerRightAligned"),HANDLE_VIEWSET_VRULER_RIGHT , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, @@ -167,6 +170,7 @@ static ChainablePropertySetInfo * lcl_createViewSettingsInfo() { RTL_CONSTASCII_STRINGPARAM ( "ShowVertScrollBar"), HANDLE_VIEWSET_VSCROLL , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, { RTL_CONSTASCII_STRINGPARAM ( "SmoothScrolling"), HANDLE_VIEWSET_SMOOTH_SCROLLING , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, { RTL_CONSTASCII_STRINGPARAM ( "SolidMarkHandles"), HANDLE_VIEWSET_SOLID_MARK_HANDLES , CPPUTYPE_BOOLEAN, PROPERTY_NONE, 0}, + { RTL_CONSTASCII_STRINGPARAM ( "VerticalRulerMetric"), HANDLE_VIEWSET_VERT_RULER_METRIC , CPPUTYPE_INT32, PROPERTY_NONE, 0}, { RTL_CONSTASCII_STRINGPARAM ( "ZoomType"), HANDLE_VIEWSET_ZOOM_TYPE , CPPUTYPE_INT16, PROPERTY_NONE, 0}, { RTL_CONSTASCII_STRINGPARAM ( "ZoomValue"), HANDLE_VIEWSET_ZOOM , CPPUTYPE_INT16, PROPERTY_NONE, 0}, { 0, 0, 0, CPPUTYPE_UNKNOWN, 0, 0 } @@ -596,6 +600,10 @@ SwXViewSettings::SwXViewSettings(sal_Bool bWebView, SwView* pVw) , mpConstViewOption ( NULL ) , bObjectValid(sal_True) , bWeb(bWebView) +, eHRulerUnit( FUNIT_CM ) +, mbApplyHRulerMetric( sal_False ) +, eVRulerUnit( FUNIT_CM ) +, mbApplyVRulerMetric( sal_False ) { // This property only exists if we have a view (ie, not at the module ) if ( !pView ) @@ -769,6 +777,34 @@ void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, c throw UnknownPropertyException(); } break; + case HANDLE_VIEWSET_HORI_RULER_METRIC: + case HANDLE_VIEWSET_VERT_RULER_METRIC: + { + sal_Int32 nUnit = -1; + if( rValue >>= nUnit ) + switch( nUnit ) + { + case FUNIT_MM: + case FUNIT_CM: + case FUNIT_POINT: + case FUNIT_PICA: + case FUNIT_INCH: + if( rInfo.mnHandle == HANDLE_VIEWSET_HORI_RULER_METRIC ) + { + eHRulerUnit = nUnit; + mbApplyHRulerMetric = sal_True; + } + else + { + eVRulerUnit = nUnit; + mbApplyVRulerMetric = sal_True; + } + break; + default: + throw IllegalArgumentException(); + } + } + break; default: throw UnknownPropertyException(); } @@ -777,13 +813,31 @@ void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, c void SwXViewSettings::_postSetValues () throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException ) { - if(mbApplyZoom && pView) - pView->SetZoom( (SvxZoomType)mpViewOption->GetZoomType(), - mpViewOption->GetZoom(), sal_True ); + if( pView ) + { + if(mbApplyZoom ) + pView->SetZoom( (SvxZoomType)mpViewOption->GetZoomType(), + mpViewOption->GetZoom(), sal_True ); + if(mbApplyHRulerMetric) + pView->ChangeTabMetric((FieldUnit)eHRulerUnit); + if(mbApplyVRulerMetric) + pView->ChangeVLinealMetric((FieldUnit)eVRulerUnit); + + } + else + { + if(mbApplyHRulerMetric) + SW_MOD()->ApplyRulerMetric( (FieldUnit)eHRulerUnit, sal_True, bWeb ); + if(mbApplyVRulerMetric) + SW_MOD()->ApplyRulerMetric( (FieldUnit)eVRulerUnit, sal_False, bWeb ); + } + SW_MOD()->ApplyUsrPref( *mpViewOption, pView, pView ? VIEWOPT_DEST_VIEW_ONLY : bWeb ? VIEWOPT_DEST_WEB : VIEWOPT_DEST_TEXT ); + + delete mpViewOption; mpViewOption = NULL; } @@ -901,6 +955,38 @@ void SwXViewSettings::_getSingleValue( const comphelper::PropertyInfo & rInfo, u throw UnknownPropertyException(); } break; + case HANDLE_VIEWSET_HORI_RULER_METRIC: + { + if ( pView ) + { + FieldUnit eUnit; + pView->GetHLinealMetric( eUnit ); + rValue <<= (sal_Int32)eUnit; + } + else + { + const SwMasterUsrPref* pUsrPref = SW_MOD()->GetUsrPref( bWeb ); + rValue <<= (sal_Int32)pUsrPref->GetHScrollMetric(); + } + bBool = sal_False; + } + break; + case HANDLE_VIEWSET_VERT_RULER_METRIC: + { + if ( pView ) + { + FieldUnit eUnit; + pView->GetVLinealMetric( eUnit ); + rValue <<= (sal_Int32)eUnit; + } + else + { + const SwMasterUsrPref* pUsrPref = SW_MOD()->GetUsrPref( bWeb ); + rValue <<= (sal_Int32)pUsrPref->GetVScrollMetric(); + } + bBool = sal_False; + } + break; default: DBG_ERROR("Diese Id gibt's nicht!"); } if( bBool ) |