summaryrefslogtreecommitdiff
path: root/sw/source/ui/config
diff options
context:
space:
mode:
authorThomas Lange [tl] <tl@openoffice.org>2010-11-03 15:50:00 +0100
committerThomas Lange [tl] <tl@openoffice.org>2010-11-03 15:50:00 +0100
commitefc013d327e4268fc2258bebf9bab0f298679251 (patch)
treebf915aa08dbc93db68d2e4d5bf65b76f2465e4eb /sw/source/ui/config
parentcf71abf8511eb5348233fc0022c9a5a2159f7ea4 (diff)
cws tlmath01: #i972# Math baseline alignment
Diffstat (limited to 'sw/source/ui/config')
-rw-r--r--sw/source/ui/config/cfgitems.cxx1
-rw-r--r--sw/source/ui/config/makefile.mk3
-rw-r--r--sw/source/ui/config/optdlg.hrc15
-rw-r--r--[-rwxr-xr-x]sw/source/ui/config/optdlg.src12
-rw-r--r--[-rwxr-xr-x]sw/source/ui/config/optpage.cxx58
-rw-r--r--sw/source/ui/config/usrpref.cxx102
6 files changed, 84 insertions, 107 deletions
diff --git a/sw/source/ui/config/cfgitems.cxx b/sw/source/ui/config/cfgitems.cxx
index 3a462ce452b2..8652970d588f 100644
--- a/sw/source/ui/config/cfgitems.cxx
+++ b/sw/source/ui/config/cfgitems.cxx
@@ -458,4 +458,3 @@ int SwTestItem::operator==( const SfxPoolItem& rAttr ) const
#endif
-
diff --git a/sw/source/ui/config/makefile.mk b/sw/source/ui/config/makefile.mk
index 4b8ed01ca90e..c093b18ce036 100644
--- a/sw/source/ui/config/makefile.mk
+++ b/sw/source/ui/config/makefile.mk
@@ -83,5 +83,4 @@ LIB1OBJFILES = \
# --- Targets -------------------------------------------------------
-.INCLUDE : target.mk
-
+.INCLUDE : target.mk \ No newline at end of file
diff --git a/sw/source/ui/config/optdlg.hrc b/sw/source/ui/config/optdlg.hrc
index 4162b656d7e5..5d93219fed98 100644
--- a/sw/source/ui/config/optdlg.hrc
+++ b/sw/source/ui/config/optdlg.hrc
@@ -30,7 +30,7 @@
#define FL_NOPRINT 2
#define FL_WINDOW 3
-#define CB_GRF 1
+#define CB_GRF 1
#define CB_TBL 2
#define CB_DRWFAST 3
#define CB_FIELD 4
@@ -39,10 +39,10 @@
#define CB_SPACE 7
#define CB_HSPACE 8
#define CB_SHYPH 9
-#define CB_FLD_HIDDEN 10
+#define CB_FLD_HIDDEN 10
#define CB_BREAK 11
#define CB_ANY_RULER 12
-#define CB_CROSS 14
+#define CB_CROSS 14
#define CB_HSCROLL 15
#define CB_VSCROLL 16
#define CB_HRULER 17
@@ -50,7 +50,7 @@
#define FL_LINE 22
#define CB_POSTIT 23
#define CB_VRULER_RIGHT 24
-#define CB_BIGHANDLE 25
+#define CB_BIGHANDLE 25
#define FL_SETTINGS 26
#define LB_METRIC 27
@@ -191,7 +191,7 @@
#define FL_TABLE_SEPARATOR 139
#define CB_PROSPECT_RTL 140
-#define FL_SHDWCRSFLAG 1
+#define FL_SHDWCRSFLAG 1
#define CB_SHDWCRSONOFF 2
#define FL_SHDWCRSMODE 3
#define FT_SHDWCRSFILLMODE 4
@@ -201,5 +201,8 @@
#define RB_SHDWCRSFILLSPACE 8
#define CB_ALLOW_IN_PROT 12
#define FL_CRSR_OPT 13
-#define FL_SEPARATOR_SHDW 14
+#define FL_SEPARATOR_SHDW 14
+#define FL_LAYOUT_OPTIONS 15
+#define CB_MATH_BASELINE_ALIGNMENT 16
+
diff --git a/sw/source/ui/config/optdlg.src b/sw/source/ui/config/optdlg.src
index 97f903557bda..55036700f668 100755..100644
--- a/sw/source/ui/config/optdlg.src
+++ b/sw/source/ui/config/optdlg.src
@@ -941,6 +941,18 @@ TabPage TP_OPTSHDWCRSR
Group = TRUE ;
Text [ en-US ] = "Enable";
};
+ FixedLine FL_LAYOUT_OPTIONS
+ {
+ Pos = MAP_APPFONT ( 6 , 133 ) ;
+ Size = MAP_APPFONT ( 118 , 8 ) ;
+ Text [ en-US ] = "Layout assistance";
+ };
+ CheckBox CB_MATH_BASELINE_ALIGNMENT
+ {
+ Pos = MAP_APPFONT ( 12 , 144 ) ;
+ Size = MAP_APPFONT ( 236 , 10 ) ;
+ Text [ en-US ] = "Math baseline alignment";
+ };
};
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index 921d2a652002..3a1d85465653 100755..100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -31,16 +31,15 @@
#undef SW_DLLIMPLEMENTATION
#endif
-
-#include <hintids.hxx>
-#ifndef _CMDID_H
-#include <cmdid.h>
-#endif
-#include <vcl/svapp.hxx>
#ifndef _SVSTDARR_HXX
#define _SVSTDARR_STRINGSDTOR
#include <svl/svstdarr.hxx>
#endif
+
+#include <doc.hxx>
+#include <hintids.hxx>
+#include <cmdid.h>
+#include <vcl/svapp.hxx>
#include <svl/cjkoptions.hxx>
#include <svtools/ctrltool.hxx>
#include <svl/eitem.hxx>
@@ -55,15 +54,9 @@
#include <fmtcol.hxx>
#include <charatr.hxx>
#include <swtypes.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
-#ifndef IDOCUMENTDEVICEACCESS_HXX_INCLUDED
#include <IDocumentDeviceAccess.hxx>
-#endif
#include <swmodule.hxx>
#include <wrtsh.hxx>
#include <uitool.hxx>
@@ -73,26 +66,14 @@
#include <initui.hxx>
#include <optpage.hxx>
#include <swprtopt.hxx>
-#ifndef _MODCFG_HXX
#include <modcfg.hxx>
-#endif
-#ifndef _SRCVIEW_HXX
#include <srcview.hxx>
-#endif
#include <crstate.hxx>
#include <viewopt.hxx>
-#ifndef _GLOBALS_HRC
#include <globals.hrc>
-#endif
-#ifndef _CONFIG_HRC
#include <config.hrc>
-#endif
-#ifndef _REDLOPT_HRC
#include <redlopt.hrc>
-#endif
-#ifndef _OPTDLG_HRC
#include <optdlg.hrc>
-#endif
#include <svx/strarray.hxx>
#include <svl/slstitm.hxx>
#include <sfx2/request.hxx>
@@ -1510,6 +1491,7 @@ IMPL_LINK(SwTableOptionsTabPage, CheckBoxHdl, CheckBox*, EMPTYARG)
aRepeatHeaderCB.Enable(aHeaderCB.IsChecked());
return 0;
}
+
void SwTableOptionsTabPage::PageCreated (SfxAllItemSet aSet)
{
SFX_ITEMSET_ARG (&aSet,pWrtSh,SwWrtShellItem,SID_WRT_SHELL,sal_False);
@@ -1547,15 +1529,17 @@ SwShdwCrsrOptionsTabPage::SwShdwCrsrOptionsTabPage( Window* pParent,
aFillTabRB( this, SW_RES( RB_SHDWCRSFILLTAB )),
aFillSpaceRB( this, SW_RES( RB_SHDWCRSFILLSPACE )),
aCrsrOptFL ( this, SW_RES( FL_CRSR_OPT)),
- aCrsrInProtCB( this, SW_RES( CB_ALLOW_IN_PROT ))
+ aCrsrInProtCB( this, SW_RES( CB_ALLOW_IN_PROT )),
+ m_aLayoutOptionsFL( this, SW_RES( FL_LAYOUT_OPTIONS ) ),
+ m_aMathBaselineAlignmentCB( this, SW_RES( CB_MATH_BASELINE_ALIGNMENT ) ),
+ m_pWrtShell( NULL )
{
FreeResource();
const SfxPoolItem* pItem = 0;
- SwShadowCursorItem aOpt;
+ SwShadowCursorItem aOpt;
if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_SHADOWCURSOR, FALSE, &pItem ))
aOpt = *(SwShadowCursorItem*)pItem;
-
aOnOffCB.Check( aOpt.IsOn() );
BYTE eMode = aOpt.GetMode();
@@ -1600,6 +1584,15 @@ SfxTabPage* SwShdwCrsrOptionsTabPage::Create( Window* pParent, const SfxItemSet&
return new SwShdwCrsrOptionsTabPage( pParent, rSet );
}
+
+void SwShdwCrsrOptionsTabPage::PageCreated( SfxAllItemSet aSet )
+{
+ SFX_ITEMSET_ARG (&aSet,pWrtSh,SwWrtShellItem,SID_WRT_SHELL,sal_False);
+ if (pWrtSh)
+ SetWrtShell(pWrtSh->GetValue());
+}
+
+
BOOL SwShdwCrsrOptionsTabPage::FillItemSet( SfxItemSet& rSet )
{
SwShadowCursorItem aOpt;
@@ -1625,6 +1618,10 @@ BOOL SwShdwCrsrOptionsTabPage::FillItemSet( SfxItemSet& rSet )
bRet = TRUE;
}
+ m_pWrtShell->GetDoc()->set( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT,
+ m_aMathBaselineAlignmentCB.IsChecked() );
+ bRet |= m_aMathBaselineAlignmentCB.IsChecked() != m_aMathBaselineAlignmentCB.GetSavedValue();
+
if( aCrsrInProtCB.IsChecked() != aCrsrInProtCB.GetSavedValue())
{
rSet.Put(SfxBoolItem(FN_PARAM_CRSR_IN_PROTECTED, aCrsrInProtCB.IsChecked()));
@@ -1658,11 +1655,10 @@ BOOL SwShdwCrsrOptionsTabPage::FillItemSet( SfxItemSet& rSet )
void SwShdwCrsrOptionsTabPage::Reset( const SfxItemSet& rSet )
{
const SfxPoolItem* pItem = 0;
- SwShadowCursorItem aOpt;
+ SwShadowCursorItem aOpt;
if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_SHADOWCURSOR, FALSE, &pItem ))
aOpt = *(SwShadowCursorItem*)pItem;
-
aOnOffCB.Check( aOpt.IsOn() );
BYTE eMode = aOpt.GetMode();
@@ -1671,6 +1667,9 @@ void SwShdwCrsrOptionsTabPage::Reset( const SfxItemSet& rSet )
aFillTabRB.Check( FILL_TAB == eMode );
aFillSpaceRB.Check( FILL_SPACE == eMode );
+ m_aMathBaselineAlignmentCB.Check( m_pWrtShell->GetDoc()->get( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT ) );
+ m_aMathBaselineAlignmentCB.SaveValue();
+
if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_CRSR_IN_PROTECTED, FALSE, &pItem ))
aCrsrInProtCB.Check(((const SfxBoolItem*)pItem)->GetValue());
aCrsrInProtCB.SaveValue();
@@ -2615,4 +2614,3 @@ IMPL_LINK_INLINE_END( SwTestTabPage, AutoClickHdl, CheckBox *, EMPTYARG )
#endif
-
diff --git a/sw/source/ui/config/usrpref.cxx b/sw/source/ui/config/usrpref.cxx
index 4386019dfb07..8d79abfb6244 100644
--- a/sw/source/ui/config/usrpref.cxx
+++ b/sw/source/ui/config/usrpref.cxx
@@ -258,7 +258,7 @@ Sequence<OUString> SwLayoutViewConfig::GetPropertyNames()
"Window/SmoothScroll", //10
"Zoom/Value", //11
"Zoom/Type", //12
- "Other/IsAlignMathObjectsToBaseline" //13
+ "Other/IsAlignMathObjectsToBaseline", //13
"Other/MeasureUnit", //14
// below properties are not available in WriterWeb
"Other/TabStop", //15
@@ -304,40 +304,38 @@ void SwLayoutViewConfig::Commit()
for(int nProp = 0; nProp < aNames.getLength(); nProp++)
{
- sal_Bool bSet;
+ Any &rVal = pValues[nProp];
switch(nProp)
{
- case 0: bSet = rParent.IsCrossHair(); break; // "Line/Guide",
- case 1: bSet = rParent.IsSolidMarkHdl(); break; // "Line/SimpleControlPoint",
- case 2: bSet = rParent.IsBigMarkHdl(); break; // "Line/LargeControlPoint",
- case 3: bSet = rParent.IsViewHScrollBar(); break; // "Window/HorizontalScroll",
- case 4: bSet = rParent.IsViewVScrollBar(); break; // "Window/VerticalScroll",
- case 5: bSet = rParent.IsViewAnyRuler(); break; // "Window/ShowRulers"
+ case 0: rVal <<= (sal_Bool) rParent.IsCrossHair(); break; // "Line/Guide",
+ case 1: rVal <<= (sal_Bool) rParent.IsSolidMarkHdl(); break; // "Line/SimpleControlPoint",
+ case 2: rVal <<= (sal_Bool) rParent.IsBigMarkHdl(); break; // "Line/LargeControlPoint",
+ case 3: rVal <<= (sal_Bool) rParent.IsViewHScrollBar(); break; // "Window/HorizontalScroll",
+ case 4: rVal <<= (sal_Bool) rParent.IsViewVScrollBar(); break; // "Window/VerticalScroll",
+ case 5: rVal <<= (sal_Bool) rParent.IsViewAnyRuler(); break; // "Window/ShowRulers"
// #i14593# use IsView*Ruler(TRUE) instead of IsView*Ruler()
// this preserves the single ruler states even if "Window/ShowRulers" is off
- case 6: bSet = rParent.IsViewHRuler(TRUE); break; // "Window/HorizontalRuler",
- case 7: bSet = rParent.IsViewVRuler(TRUE); break; // "Window/VerticalRuler",
+ case 6: rVal <<= (sal_Bool) rParent.IsViewHRuler(TRUE); break; // "Window/HorizontalRuler",
+ case 7: rVal <<= (sal_Bool) rParent.IsViewVRuler(TRUE); break; // "Window/VerticalRuler",
case 8:
if(rParent.bIsHScrollMetricSet)
- pValues[nProp] <<= (sal_Int32)rParent.eHScrollMetric; // "Window/HorizontalRulerUnit"
+ rVal <<= (sal_Int32)rParent.eHScrollMetric; // "Window/HorizontalRulerUnit"
break;
case 9:
if(rParent.bIsVScrollMetricSet)
- pValues[nProp] <<= (sal_Int32)rParent.eVScrollMetric; // "Window/VerticalRulerUnit"
+ rVal <<= (sal_Int32)rParent.eVScrollMetric; // "Window/VerticalRulerUnit"
break;
- case 10: bSet = rParent.IsSmoothScroll(); break; // "Window/SmoothScroll",
- case 11: pValues[nProp] <<= (sal_Int32)rParent.GetZoom(); break; // "Zoom/Value",
- case 12: pValues[nProp] <<= (sal_Int32)rParent.GetZoomType(); break;// "Zoom/Type",
- case 13: bSet = rParent.IsAlignMathObjectsToBaseline(); break; // "Other/IsAlignMathObjectsToBaseline"
- case 14: pValues[nProp] <<= (sal_Int32)rParent.GetMetric(); break; // "Other/MeasureUnit",
- case 15: pValues[nProp] <<= static_cast<sal_Int32>(TWIP_TO_MM100(rParent.GetDefTab())); break;// "Other/TabStop",
- case 16: bSet = rParent.IsVRulerRight(); break; // "Window/IsVerticalRulerRight",
- case 17: pValues[nProp] <<= (sal_Int32)rParent.GetViewLayoutColumns(); break;// "ViewLayout/Columns",
- case 18: bSet = rParent.IsViewLayoutBookMode(); break; // "ViewLayout/BookMode",
- case 19: bSet = rParent.IsSquaredPageMode(); break; // "Other/IsSquaredPageMode",
+ case 10: rVal <<= (sal_Bool) rParent.IsSmoothScroll(); break; // "Window/SmoothScroll",
+ case 11: rVal <<= (sal_Int32)rParent.GetZoom(); break; // "Zoom/Value",
+ case 12: rVal <<= (sal_Int32)rParent.GetZoomType(); break; // "Zoom/Type",
+ case 13: rVal <<= (sal_Bool) rParent.IsAlignMathObjectsToBaseline(); break; // "Other/IsAlignMathObjectsToBaseline"
+ case 14: rVal <<= (sal_Int32)rParent.GetMetric(); break; // "Other/MeasureUnit",
+ case 15: rVal <<= static_cast<sal_Int32>(TWIP_TO_MM100(rParent.GetDefTab())); break;// "Other/TabStop",
+ case 16: rVal <<= (sal_Bool) rParent.IsVRulerRight(); break; // "Window/IsVerticalRulerRight",
+ case 17: rVal <<= (sal_Int32)rParent.GetViewLayoutColumns(); break; // "ViewLayout/Columns",
+ case 18: rVal <<= (sal_Bool) rParent.IsViewLayoutBookMode(); break; // "ViewLayout/BookMode",
+ case 19: rVal <<= (sal_Bool) rParent.IsSquaredPageMode(); break; // "Other/IsSquaredPageMode",
}
- if(nProp < 8 || nProp == 10 || nProp == 15 || nProp == 17 || nProp == 18 )
- pValues[nProp].setValue(&bSet, ::getBooleanCppuType());
}
PutProperties(aNames, aValues);
}
@@ -356,7 +354,11 @@ void SwLayoutViewConfig::Load()
{
if(pValues[nProp].hasValue())
{
- sal_Bool bSet = nProp < 8 || nProp == 10 || nProp == 17 || nProp == 18 ? *(sal_Bool*)pValues[nProp].getValue() : sal_False;
+ sal_Int32 nInt32Val = 0;
+ sal_Bool bSet = sal_False;
+ pValues[nProp] >>= nInt32Val;
+ pValues[nProp] >>= bSet;
+
switch(nProp)
{
case 0: rParent.SetCrossHair(bSet); break;// "Line/Guide",
@@ -370,59 +372,23 @@ void SwLayoutViewConfig::Load()
case 8:
{
rParent.bIsHScrollMetricSet = sal_True;
- sal_Int32 nUnit = 0;
- pValues[nProp] >>= nUnit;
- rParent.eHScrollMetric = ((FieldUnit)nUnit); // "Window/HorizontalRulerUnit"
+ rParent.eHScrollMetric = ((FieldUnit)nInt32Val); // "Window/HorizontalRulerUnit"
}
break;
case 9:
{
rParent.bIsVScrollMetricSet = sal_True;
- sal_Int32 nUnit = 0;
- pValues[nProp] >>= nUnit;
- rParent.eVScrollMetric = ((FieldUnit)nUnit); // "Window/VerticalRulerUnit"
+ rParent.eVScrollMetric = ((FieldUnit)nInt32Val); // "Window/VerticalRulerUnit"
}
break;
case 10: rParent.SetSmoothScroll(bSet); break;// "Window/SmoothScroll",
- case 11:
- {
- sal_Int32 nVal = 0;
- pValues[nProp] >>= nVal;
- rParent.SetZoom( static_cast< USHORT >(nVal) );
- }
- break;// "Zoom/Value",
- case 12:
- {
- sal_Int32 nVal = 0;
- pValues[nProp] >>= nVal;
- rParent.SetZoomType( static_cast< SvxZoomType >(nVal) );
- }
- break;// "Zoom/Type",
-
+ case 11: rParent.SetZoom( static_cast< USHORT >(nInt32Val) ); break;// "Zoom/Value",
+ case 12: rParent.SetZoomType( static_cast< SvxZoomType >(nInt32Val) ); break;// "Zoom/Type",
case 13: rParent.SetAlignMathObjectsToBaseline(bSet); break;// "Other/IsAlignMathObjectsToBaseline"
-
- case 14:
- {
- sal_Int32 nUnit = 0;
- pValues[nProp] >>= nUnit;
- rParent.SetMetric((FieldUnit)nUnit, TRUE);
- }
- break;// "Other/MeasureUnit",
- case 15:
- {
- sal_Int32 nTab = 0;
- pValues[nProp] >>= nTab;
- rParent.SetDefTab(MM100_TO_TWIP(nTab), TRUE);
- }
- break;// "Other/TabStop",
+ case 14: rParent.SetMetric((FieldUnit)nInt32Val, TRUE); break;// "Other/MeasureUnit",
+ case 15: rParent.SetDefTab(MM100_TO_TWIP(nInt32Val), TRUE); break;// "Other/TabStop",
case 16: rParent.SetVRulerRight(bSet); break;// "Window/IsVerticalRulerRight",
- case 17:
- {
- sal_Int32 nColumns = 0;
- pValues[nProp] >>= nColumns;
- rParent.SetViewLayoutColumns( static_cast<USHORT>(nColumns) );
- }
- break;// "ViewLayout/Columns",
+ case 17: rParent.SetViewLayoutColumns( static_cast<USHORT>(nInt32Val) ); break;// "ViewLayout/Columns",
case 18: rParent.SetViewLayoutBookMode(bSet); break;// "ViewLayout/BookMode",
case 19: rParent.SetDefaultPageMode(bSet,TRUE); break;// "Other/IsSquaredPageMode",
}