summaryrefslogtreecommitdiff
path: root/sw/source/ui
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/ui')
-rw-r--r--sw/source/ui/app/appopt.cxx83
-rw-r--r--sw/source/ui/app/docshini.cxx7
-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--sw/source/ui/config/optdlg.src12
-rw-r--r--sw/source/ui/config/optpage.cxx74
-rw-r--r--sw/source/ui/config/usrpref.cxx146
-rw-r--r--sw/source/ui/dialog/swdlgfact.hxx2
-rw-r--r--sw/source/ui/frmdlg/frmdlg.cxx4
-rw-r--r--sw/source/ui/frmdlg/frmpage.cxx44
-rw-r--r--sw/source/ui/inc/frmdlg.hxx1
-rw-r--r--sw/source/ui/inc/frmpage.hxx15
-rw-r--r--sw/source/ui/inc/optpage.hxx11
-rw-r--r--sw/source/ui/inc/usrpref.hxx9
-rw-r--r--sw/source/ui/shells/basesh.cxx8
-rw-r--r--sw/source/ui/shells/frmsh.cxx17
-rw-r--r--sw/source/ui/uiview/swcli.cxx22
-rw-r--r--[-rwxr-xr-x]sw/source/ui/uno/SwXDocumentSettings.cxx16
-rw-r--r--sw/source/ui/wrtsh/wrtsh1.cxx38
20 files changed, 310 insertions, 218 deletions
diff --git a/sw/source/ui/app/appopt.cxx b/sw/source/ui/app/appopt.cxx
index a248ac8aff..ae6e4720b2 100644
--- a/sw/source/ui/app/appopt.cxx
+++ b/sw/source/ui/app/appopt.cxx
@@ -27,19 +27,15 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-#include <hintids.hxx>
-#ifndef _CMDID_H
-#include <cmdid.h> // Funktion-Ids
-#endif
-
-#include <com/sun/star/i18n/ScriptType.hpp>
#define _SVSTDARR_STRINGSDTOR
#include <svl/svstdarr.hxx>
-#ifndef _MSGBOX_HXX //autogen
+#include <com/sun/star/i18n/ScriptType.hpp>
+
+#include <hintids.hxx>
+#include <cmdid.h> // Funktion-Ids
#include <vcl/msgbox.hxx>
-#endif
#include <svl/eitem.hxx>
#include <sfx2/request.hxx>
#include <sfx2/app.hxx>
@@ -47,9 +43,7 @@
#include <svx/htmlmode.hxx>
#include <sfx2/bindings.hxx>
#include <editeng/brshitem.hxx>
-#ifndef _SVX_TSTPITEM_HXX //autogen
#include <editeng/tstpitem.hxx>
-#endif
#include <svx/optgrid.hxx>
#include <svx/svxdlg.hxx>
#include <svx/dialogs.hrc>
@@ -59,37 +53,25 @@
#include <optcomp.hxx>
#include <edtwin.hxx>
#include <swmodule.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
+#include <doc.hxx>
#include <wrtsh.hxx>
-#ifndef IDOCUMENTDEVICEACCESS_HXX_INCLUDED
#include <IDocumentDeviceAccess.hxx>
-#endif
#include <uitool.hxx>
#include <initui.hxx> // fuer ::GetGlossaries()
#include <fldbas.hxx> //fuer UpdateFields
-#ifndef _WVIEW_HXX
#include <wview.hxx>
-#endif
#include <cfgitems.hxx>
#include <prtopt.hxx>
-#ifndef _PVIEW_HXX
#include <pview.hxx>
-#endif
#include <usrpref.hxx>
-#ifndef _MODCFG_HXX
#include <modcfg.hxx>
-#endif
#include <glosdoc.hxx>
#include <uiitems.hxx>
#include <editeng/langitem.hxx>
#include <unotools/lingucfg.hxx>
#include <editeng/unolingu.hxx>
-
-#ifndef _GLOBALS_HRC
#include <globals.hrc>
-#endif
#include <globals.h> // globale Konstanten z.B.
#include <svl/slstitm.hxx>
#include "swabstdlg.hxx"
@@ -334,8 +316,7 @@ void SwModule::ApplyItemSet( USHORT nId, const SfxItemSet& rSet )
/*---------------------------------------------------------------------
Seite Dokumentansicht auswerten
-----------------------------------------------------------------------*/
- if( SFX_ITEM_SET == rSet.GetItemState(
- FN_PARAM_DOCDISP, FALSE, &pItem ))
+ if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_DOCDISP, FALSE, &pItem ))
{
const SwDocDisplayItem* pDocDispItem = (const SwDocDisplayItem*)pItem;
@@ -364,23 +345,20 @@ void SwModule::ApplyItemSet( USHORT nId, const SfxItemSet& rSet )
Elemente - Item auswerten
-----------------------------------------------------------------------*/
- if( SFX_ITEM_SET == rSet.GetItemState(
- FN_PARAM_ELEM, FALSE, &pItem ) )
+ if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_ELEM, FALSE, &pItem ) )
{
const SwElemItem* pElemItem = (const SwElemItem*)pItem;
pElemItem->FillViewOptions( aViewOpt );
}
- if( SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_METRIC,
- FALSE, &pItem ) )
+ if( SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_METRIC, FALSE, &pItem ) )
{
SFX_APP()->SetOptions(rSet);
const SfxUInt16Item* pMetricItem = (const SfxUInt16Item*)pItem;
::SetDfltMetric((FieldUnit)pMetricItem->GetValue(), !bTextDialog);
}
- if( SFX_ITEM_SET == rSet.GetItemState(FN_HSCROLL_METRIC,
- FALSE, &pItem ) )
+ if( SFX_ITEM_SET == rSet.GetItemState(FN_HSCROLL_METRIC, FALSE, &pItem ) )
{
const SfxUInt16Item* pMetricItem = (const SfxUInt16Item*)pItem;
FieldUnit eUnit = (FieldUnit)pMetricItem->GetValue();
@@ -389,8 +367,7 @@ void SwModule::ApplyItemSet( USHORT nId, const SfxItemSet& rSet )
pAppView->ChangeTabMetric(eUnit);
}
- if( SFX_ITEM_SET == rSet.GetItemState(FN_VSCROLL_METRIC,
- FALSE, &pItem ) )
+ if( SFX_ITEM_SET == rSet.GetItemState(FN_VSCROLL_METRIC, FALSE, &pItem ) )
{
const SfxUInt16Item* pMetricItem = (const SfxUInt16Item*)pItem;
FieldUnit eUnit = (FieldUnit)pMetricItem->GetValue();
@@ -399,8 +376,7 @@ void SwModule::ApplyItemSet( USHORT nId, const SfxItemSet& rSet )
pAppView->ChangeVLinealMetric(eUnit);
}
- if( SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_DEFTABSTOP,
- FALSE, &pItem ) )
+ if( SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_DEFTABSTOP, FALSE, &pItem ) )
{
USHORT nTabDist = ((const SfxUInt16Item*)pItem)->GetValue();
pPref->SetDefTab(nTabDist);
@@ -427,8 +403,7 @@ void SwModule::ApplyItemSet( USHORT nId, const SfxItemSet& rSet )
Seite Rastereinstellungen auswerten
----------------------------------------------------------------------*/
- if( SFX_ITEM_SET == rSet.GetItemState(
- SID_ATTR_GRID_OPTIONS, FALSE, &pItem ))
+ if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_GRID_OPTIONS, FALSE, &pItem ))
{
const SvxGridItem* pGridItem = (const SvxGridItem*)pItem;
@@ -458,8 +433,7 @@ void SwModule::ApplyItemSet( USHORT nId, const SfxItemSet& rSet )
// Writer Drucker Zusatzeinstellungen auswerten
//----------------------------------------------------------------------------
- if( SFX_ITEM_SET == rSet.GetItemState(
- FN_PARAM_ADDPRINTER, FALSE, &pItem ))
+ if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_ADDPRINTER, FALSE, &pItem ))
{
SwPrintOptions* pOpt = GetPrtOptions(!bTextDialog);
if (pOpt)
@@ -473,16 +447,25 @@ void SwModule::ApplyItemSet( USHORT nId, const SfxItemSet& rSet )
}
- if( SFX_ITEM_SET == rSet.GetItemState(
- FN_PARAM_SHADOWCURSOR, FALSE, &pItem ))
+ if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_SHADOWCURSOR, FALSE, &pItem ))
{
((SwShadowCursorItem*)pItem)->FillViewOptions( aViewOpt );
if(pBindings)
pBindings->Invalidate(FN_SHADOWCURSOR);
}
- if( SFX_ITEM_SET == rSet.GetItemState(
- FN_PARAM_CRSR_IN_PROTECTED, FALSE, &pItem ))
+ if( pAppView )
+ {
+ SwWrtShell &rWrtSh = pAppView->GetWrtShell();
+ const bool bAlignFormulas = rWrtSh.GetDoc()->get( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT );
+ pPref->SetAlignMathObjectsToBaseline( bAlignFormulas );
+
+ // don't align formulas in documents that are currently loading
+ if (bAlignFormulas && !rWrtSh.GetDoc()->IsInReading())
+ rWrtSh.AlignAllFormulasToBaseline();
+ }
+
+ if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_CRSR_IN_PROTECTED, FALSE, &pItem ))
{
aViewOpt.SetCursorInProtectedArea(((const SfxBoolItem*)pItem)->GetValue());
}
@@ -510,8 +493,7 @@ void SwModule::ApplyItemSet( USHORT nId, const SfxItemSet& rSet )
}
#endif
// dann an der akt. View und Shell die entsp. Elemente setzen
- ApplyUsrPref( aViewOpt, pAppView,
- bTextDialog? VIEWOPT_DEST_TEXT : VIEWOPT_DEST_WEB);
+ ApplyUsrPref( aViewOpt, pAppView, bTextDialog? VIEWOPT_DEST_TEXT : VIEWOPT_DEST_WEB);
}
/* -----------------12.02.99 12:28-------------------
*
@@ -609,6 +591,15 @@ SfxTabPage* SwModule::CreateTabPage( USHORT nId, Window* pParent, const SfxItemS
if ( fnCreatePage )
pRet = (*fnCreatePage)( pParent, rSet );
}
+ if (pRet && (nId == RID_SW_TP_OPTSHDWCRSR || nId == RID_SW_TP_HTML_OPTSHDWCRSR))
+ {
+ SwView* pCurrView = GetView();
+ if(pCurrView)
+ {
+ aSet.Put( SwWrtShellItem( SID_WRT_SHELL, pCurrView->GetWrtShellPtr() ) );
+ pRet->PageCreated(aSet);
+ }
+ }
}
break;
#ifdef DBG_UTIL
@@ -653,5 +644,3 @@ SfxTabPage* SwModule::CreateTabPage( USHORT nId, Window* pParent, const SfxItemS
return pRet;
}
-
-
diff --git a/sw/source/ui/app/docshini.cxx b/sw/source/ui/app/docshini.cxx
index 4b0e3575a6..f9ee757b23 100644
--- a/sw/source/ui/app/docshini.cxx
+++ b/sw/source/ui/app/docshini.cxx
@@ -336,6 +336,12 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
pColl->SetFmtAttr( aFontHeight );
}
}
+
+ // the default for documents created via 'File/New' should be 'on'
+ // (old documents, where this property was not yet implemented, will get the
+ // value 'false' in the SwDoc c-tor)
+ pDoc->set( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT,
+ SW_MOD()->GetUsrPref( bWeb )->IsAlignMathObjectsToBaseline() );
}
/* #106748# If the default frame direction of a document is RTL
@@ -823,4 +829,3 @@ void SwDocShell::SubInitNew()
IDocumentDeviceAccess* SwDocShell::getIDocumentDeviceAccess() { return pDoc; }
const IDocumentSettingAccess* SwDocShell::getIDocumentSettingAccess() const { return pDoc; }
IDocumentChartDataProviderAccess* SwDocShell::getIDocumentChartDataProviderAccess() { return pDoc; }
-
diff --git a/sw/source/ui/config/cfgitems.cxx b/sw/source/ui/config/cfgitems.cxx
index 352819a184..6fa2666579 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 4b8ed01ca9..c093b18ce0 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 31f2e7041f..d58d1b6ac4 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 9f7b76401b..bd7133612a 100644
--- a/sw/source/ui/config/optdlg.src
+++ b/sw/source/ui/config/optdlg.src
@@ -1021,6 +1021,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 9907d16191..126cc68852 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -32,22 +32,15 @@
#undef SW_DLLIMPLEMENTATION
#endif
-#include <hintids.hxx>
-#include <cmdid.h>
-#include <vcl/svapp.hxx>
+#ifndef _SVSTDARR_HXX
#define _SVSTDARR_STRINGSDTOR
#include <svl/svstdarr.hxx>
-#include <svl/cjkoptions.hxx>
-#include <svtools/ctrltool.hxx>
-#include <svl/eitem.hxx>
-#include <svx/htmlmode.hxx>
-#include <sfx2/printer.hxx>
-#include <sfx2/bindings.hxx>
-#include <svx/xtable.hxx>
-#include <editeng/fhgtitem.hxx>
-#include <editeng/fontitem.hxx>
-#include <editeng/langitem.hxx>
-#include <svx/dlgutil.hxx>
+#endif
+
+#include <optpage.hxx>
+#include <doc.hxx>
+#include <hintids.hxx>
+#include <cmdid.h>
#include <fmtcol.hxx>
#include <charatr.hxx>
#include <swtypes.hxx>
@@ -57,11 +50,10 @@
#include <swmodule.hxx>
#include <wrtsh.hxx>
#include <uitool.hxx>
-#include <cfgitems.hxx> //Items fuer Sw-Seiten
+#include <cfgitems.hxx>
#include <poolfmt.hxx>
#include <uiitems.hxx>
#include <initui.hxx>
-#include <optpage.hxx>
#include <printdata.hxx>
#include <modcfg.hxx>
#include <srcview.hxx>
@@ -71,13 +63,26 @@
#include <config.hrc>
#include <redlopt.hrc>
#include <optdlg.hrc>
-#include <svx/strarray.hxx>
-#include <svl/slstitm.hxx>
-#include <sfx2/request.hxx>
#include <swwrtshitem.hxx>
+#include <unomid.h>
+
+#include <editeng/fhgtitem.hxx>
+#include <editeng/fontitem.hxx>
+#include <editeng/langitem.hxx>
+#include <sfx2/request.hxx>
+#include <sfx2/printer.hxx>
+#include <sfx2/bindings.hxx>
+#include <svl/slstitm.hxx>
#include <svl/ctloptions.hxx>
+#include <svl/eitem.hxx>
+#include <svl/cjkoptions.hxx>
+#include <svtools/ctrltool.hxx>
+#include <svx/htmlmode.hxx>
+#include <svx/xtable.hxx>
+#include <svx/dlgutil.hxx>
+#include <svx/strarray.hxx>
+#include <vcl/svapp.hxx>
-#include <unomid.h>
using namespace ::com::sun::star;
@@ -1488,6 +1493,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);
@@ -1525,15 +1531,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();
@@ -1578,6 +1586,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;
@@ -1603,6 +1620,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()));
@@ -1636,11 +1657,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();
@@ -1649,6 +1669,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();
@@ -2593,4 +2616,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 2571361b6d..46cd317ed1 100644
--- a/sw/source/ui/config/usrpref.cxx
+++ b/sw/source/ui/config/usrpref.cxx
@@ -245,27 +245,29 @@ Sequence<OUString> SwLayoutViewConfig::GetPropertyNames()
{
static const char* aPropNames[] =
{
- "Line/Guide", // 0
- "Line/SimpleControlPoint", // 1
- "Line/LargeControlPoint", // 2
- "Window/HorizontalScroll", // 3
- "Window/VerticalScroll", // 4
- "Window/ShowRulers", // 5
- "Window/HorizontalRuler", // 6
- "Window/VerticalRuler", // 7
- "Window/HorizontalRulerUnit", // 8
- "Window/VerticalRulerUnit", // 9
- "Window/SmoothScroll", //10
- "Zoom/Value", //11
- "Zoom/Type", //12
- "Other/MeasureUnit", //13
- "Other/TabStop", //14
- "Window/IsVerticalRulerRight", //15
- "ViewLayout/Columns", //16
- "ViewLayout/BookMode", //17
- "Other/IsSquaredPageMode" //18
+ "Line/Guide", // 0
+ "Line/SimpleControlPoint", // 1
+ "Line/LargeControlPoint", // 2
+ "Window/HorizontalScroll", // 3
+ "Window/VerticalScroll", // 4
+ "Window/ShowRulers", // 5
+ "Window/HorizontalRuler", // 6
+ "Window/VerticalRuler", // 7
+ "Window/HorizontalRulerUnit", // 8
+ "Window/VerticalRulerUnit", // 9
+ "Window/SmoothScroll", //10
+ "Zoom/Value", //11
+ "Zoom/Type", //12
+ "Other/IsAlignMathObjectsToBaseline", //13
+ "Other/MeasureUnit", //14
+ // below properties are not available in WriterWeb
+ "Other/TabStop", //15
+ "Window/IsVerticalRulerRight", //16
+ "ViewLayout/Columns", //17
+ "ViewLayout/BookMode", //18
+ "Other/IsSquaredPageMode" //19
};
- const int nCount = bWeb ? 14 : 19;
+ const int nCount = bWeb ? 15 : 20;
Sequence<OUString> aNames(nCount);
OUString* pNames = aNames.getArray();
for(int i = 0; i < nCount; i++)
@@ -302,39 +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: pValues[nProp] <<= (sal_Int32)rParent.GetMetric(); break;// "Other/MeasureUnit",
- case 14: pValues[nProp] <<= static_cast<sal_Int32>(TWIP_TO_MM100(rParent.GetDefTab())); break;// "Other/TabStop",
- case 15: bSet = rParent.IsVRulerRight(); break;// "Window/IsVerticalRulerRight",
- case 16: pValues[nProp] <<= (sal_Int32)rParent.GetViewLayoutColumns(); break;// "ViewLayout/Columns",
- case 17: bSet = rParent.IsViewLayoutBookMode(); break;// "ViewLayout/BookMode",
- case 18: 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);
}
@@ -353,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",
@@ -367,58 +372,25 @@ 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 13:
- {
- sal_Int32 nUnit = 0;
- pValues[nProp] >>= nUnit;
- rParent.SetMetric((FieldUnit)nUnit, TRUE);
- }
- break;// "Other/MeasureUnit",
- case 14:
- {
- sal_Int32 nTab = 0;
- pValues[nProp] >>= nTab;
- rParent.SetDefTab(MM100_TO_TWIP(nTab), TRUE);
- }
- break;// "Other/TabStop",
- case 15: rParent.SetVRulerRight(bSet); break;// "Window/IsVerticalRulerRight",
- case 16:
- {
- sal_Int32 nColumns = 0;
- pValues[nProp] >>= nColumns;
- rParent.SetViewLayoutColumns( static_cast<USHORT>(nColumns) );
- }
- break;// "ViewLayout/Columns",
- case 17: rParent.SetViewLayoutBookMode(bSet); break;// "ViewLayout/BookMode",
- case 18: rParent.SetDefaultPageMode(bSet,TRUE); break;// "Other/IsSquaredPageMode",
+ 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: 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: 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",
}
}
}
diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx
index f31e35e05a..3793d6c57f 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -582,5 +582,3 @@ struct SwDialogsResMgr
};
#endif
-
-
diff --git a/sw/source/ui/frmdlg/frmdlg.cxx b/sw/source/ui/frmdlg/frmdlg.cxx
index 413845f1eb..52280136a8 100644
--- a/sw/source/ui/frmdlg/frmdlg.cxx
+++ b/sw/source/ui/frmdlg/frmdlg.cxx
@@ -93,7 +93,8 @@ SwFrmDlg::SwFrmDlg( SfxViewFrame* pViewFrame,
aTmp += *pStr;
aTmp += ')';
}
- AddTabPage(TP_FRM_STD, SwFrmPage::Create, 0);
+
+ AddTabPage(TP_FRM_STD, SwFrmPage::Create, 0);
AddTabPage(TP_FRM_ADD, SwFrmAddPage::Create, 0);
AddTabPage(TP_FRM_WRAP, SwWrapTabPage::Create, 0);
AddTabPage(TP_FRM_URL, SwFrmURLPage::Create, 0);
@@ -217,3 +218,4 @@ void SwFrmDlg::PageCreated( USHORT nId, SfxTabPage &rPage )
break;
}
}
+
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index 8d371558d4..50e9754450 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -677,7 +677,10 @@ SwFrmPage::SwFrmPage ( Window *pParent, const SfxItemSet &rSet ) :
nOldV(text::VertOrientation::TOP),
nOldVRel(text::RelOrientation::PRINT_AREA),
pVMap( 0 ),
- pHMap( 0 )
+ pHMap( 0 ),
+ m_bAllowVertPositioning( true ),
+ m_bIsMathOLE( false ),
+ m_bIsMathBaselineAlignment( true )
{
FreeResource();
SetExchangeSupport();
@@ -782,9 +785,17 @@ void SwFrmPage::Reset( const SfxItemSet &rSet )
SetMetric( aAtHorzPosED, aMetric );
SetMetric( aAtVertPosED, aMetric );
+ const SfxPoolItem* pItem = NULL;
const SwFmtAnchor& rAnchor = (const SwFmtAnchor&)rSet.Get(RES_ANCHOR);
+ if (SFX_ITEM_SET == rSet.GetItemState(FN_OLE_IS_MATH, FALSE, &pItem))
+ m_bIsMathOLE = ((const SfxBoolItem*)pItem)->GetValue();
+ if (SFX_ITEM_SET == rSet.GetItemState(FN_MATH_BASELINE_ALIGNMENT, FALSE, &pItem))
+ m_bIsMathBaselineAlignment = ((const SfxBoolItem*)pItem)->GetValue();
+ EnableVerticalPositioning( !(m_bIsMathOLE && m_bIsMathBaselineAlignment
+ && FLY_AS_CHAR == rAnchor.GetAnchorId()) );
+
if (bFormat)
{
// Bei Formaten keine Ankerbearbeitung
@@ -812,7 +823,6 @@ void SwFrmPage::Reset( const SfxItemSet &rSet )
if ( nDlgType == DLG_FRM_GRF || nDlgType == DLG_FRM_OLE )
{
ASSERT(pSh , "shell not found");
- const SfxPoolItem* pItem;
//OS: nur fuer die Variante Einfuegen/Grafik/Eigenschaften
if(SFX_ITEM_SET == rSet.GetItemState(FN_PARAM_GRF_REALSIZE, FALSE, &pItem))
aGrfSize = ((const SvxSizeItem*)pItem)->GetSize();
@@ -1280,8 +1290,8 @@ void SwFrmPage::InitPos(RndStdIds eId,
if ( nY != LONG_MAX )
aAtVertPosED.SetValue( aAtVertPosED.Normalize(nY), FUNIT_TWIP );
}
- aAtVertPosFT.Enable( bEnable );
- aAtVertPosED.Enable( bEnable );
+ aAtVertPosFT.Enable( bEnable && m_bAllowVertPositioning );
+ aAtVertPosED.Enable( bEnable && m_bAllowVertPositioning );
UpdateExample();
}
@@ -1488,8 +1498,10 @@ ULONG SwFrmPage::FillRelLB( const FrmMap* _pMap,
}
}
- _rLB.Enable(_rLB.GetEntryCount() != 0);
- _rFT.Enable(_rLB.GetEntryCount() != 0);
+ const bool bEnable = _rLB.GetEntryCount() != 0
+ && (&_rLB != &aVertRelationLB || m_bAllowVertPositioning);
+ _rLB.Enable( bEnable );
+ _rFT.Enable( bEnable );
RelHdl(&_rLB);
@@ -1850,6 +1862,10 @@ IMPL_LINK( SwFrmPage, AnchorTypeHdl, RadioButton *, EMPTYARG )
PosHdl(&aHorizontalDLB);
PosHdl(&aVerticalDLB);
}
+
+ EnableVerticalPositioning( !(m_bIsMathOLE && m_bIsMathBaselineAlignment
+ && FLY_AS_CHAR == eId) );
+
return 0;
}
@@ -1875,7 +1891,7 @@ IMPL_LINK( SwFrmPage, PosHdl, ListBox *, pLB )
}
else
{
- BOOL bEnable = text::VertOrientation::NONE == nAlign;
+ BOOL bEnable = text::VertOrientation::NONE == nAlign && m_bAllowVertPositioning;
aAtVertPosED.Enable( bEnable );
aAtVertPosFT.Enable( bEnable );
}
@@ -2304,6 +2320,19 @@ void SwFrmPage::SetFormatUsed(BOOL bFmt)
}
}
+
+void SwFrmPage::EnableVerticalPositioning( bool bEnable )
+{
+ m_bAllowVertPositioning = bEnable;
+ aVerticalFT.Enable( bEnable );
+ aVerticalDLB.Enable( bEnable );
+ aAtVertPosFT.Enable( bEnable );
+ aAtVertPosED.Enable( bEnable );
+ aVertRelationFT.Enable( bEnable );
+ aVertRelationLB.Enable( bEnable );
+}
+
+
/*--------------------------------------------------------------------
Beschreibung:
--------------------------------------------------------------------*/
@@ -3246,4 +3275,3 @@ IMPL_LINK(SwFrmAddPage, ChainModifyHdl, ListBox*, pBox)
}
return 0;
}
-
diff --git a/sw/source/ui/inc/frmdlg.hxx b/sw/source/ui/inc/frmdlg.hxx
index fa39f4b293..43be092b58 100644
--- a/sw/source/ui/inc/frmdlg.hxx
+++ b/sw/source/ui/inc/frmdlg.hxx
@@ -41,6 +41,7 @@ class SwFrmDlg : public SfxTabDialog
BOOL m_bFormat;
BOOL m_bNew;
BOOL m_bHTMLMode;
+ bool m_bEnableVertPos;
const SfxItemSet& m_rSet;
USHORT m_nDlgType;
SwWrtShell* m_pWrtShell;
diff --git a/sw/source/ui/inc/frmpage.hxx b/sw/source/ui/inc/frmpage.hxx
index a858c23199..1f097d1c29 100644
--- a/sw/source/ui/inc/frmpage.hxx
+++ b/sw/source/ui/inc/frmpage.hxx
@@ -28,27 +28,17 @@
#ifndef _FRMPAGE_HXX
#define _FRMPAGE_HXX
-#ifndef _FIXED_HXX //autogen
#include <vcl/fixed.hxx>
-#endif
-#ifndef _BUTTON_HXX //autogen
#include <vcl/button.hxx>
-#endif
-#ifndef _LSTBOX_HXX //autogen
#include <vcl/lstbox.hxx>
-#endif
-#ifndef _FIELD_HXX //autogen
#include <vcl/field.hxx>
-#endif
#include <sfx2/tabdlg.hxx>
#include <svx/swframeposstrings.hxx>
#include <swtypes.hxx>
#include <bmpwin.hxx>
#include <svx/swframeexample.hxx>
#include <prcntfld.hxx>
-#ifndef _GLOBALS_HRC
#include <globals.hrc>
-#endif
namespace sfx2{class FileDialogHelper;}
@@ -142,6 +132,10 @@ class SwFrmPage: public SfxTabPage
FrmMap* pVMap;
FrmMap* pHMap;
+ bool m_bAllowVertPositioning;
+ bool m_bIsMathOLE;
+ bool m_bIsMathBaselineAlignment;
+
virtual void ActivatePage(const SfxItemSet& rSet);
virtual int DeactivatePage(SfxItemSet *pSet);
@@ -205,6 +199,7 @@ public:
void SetFormatUsed(BOOL bFmt);
void SetFrmType(USHORT nType) { nDlgType = nType; }
inline BOOL IsInGraficMode( void ) { return nDlgType == DLG_FRM_GRF || nDlgType == DLG_FRM_OLE; }
+ void EnableVerticalPositioning( bool bEnable );
};
class SwGrfExtPage: public SfxTabPage
diff --git a/sw/source/ui/inc/optpage.hxx b/sw/source/ui/inc/optpage.hxx
index 60e15f866b..fa0af2e473 100644
--- a/sw/source/ui/inc/optpage.hxx
+++ b/sw/source/ui/inc/optpage.hxx
@@ -353,6 +353,12 @@ class SwShdwCrsrOptionsTabPage : public SfxTabPage
FixedLine aCrsrOptFL;
CheckBox aCrsrInProtCB;
+ FixedLine m_aLayoutOptionsFL;
+ CheckBox m_aMathBaselineAlignmentCB;
+
+ SwWrtShell * m_pWrtShell;
+
+
SwShdwCrsrOptionsTabPage( Window* pParent, const SfxItemSet& rSet );
~SwShdwCrsrOptionsTabPage();
@@ -362,6 +368,9 @@ public:
virtual BOOL FillItemSet( SfxItemSet& rSet );
virtual void Reset( const SfxItemSet& rSet );
+
+ void SetWrtShell( SwWrtShell * pSh ) { m_pWrtShell = pSh; }
+ virtual void PageCreated( SfxAllItemSet aSet );
};
/*-----------------------------------------------------------------------
@@ -498,5 +507,3 @@ private:
};
#endif //PRODUCT
#endif
-
-
diff --git a/sw/source/ui/inc/usrpref.hxx b/sw/source/ui/inc/usrpref.hxx
index 9f3f3e4f39..21b3e64405 100644
--- a/sw/source/ui/inc/usrpref.hxx
+++ b/sw/source/ui/inc/usrpref.hxx
@@ -147,6 +147,8 @@ class SwMasterUsrPref : public SwViewOption
sal_Int32 nDefTab; //default tab stop distance
sal_Bool bIsSquaredPageMode; //default page mode for text grid
+ sal_Bool bIsAlignMathObjectsToBaseline;
+
SwContentViewConfig aContentConfig;
SwLayoutViewConfig aLayoutConfig;
SwGridConfig aGridConfig;
@@ -271,6 +273,13 @@ public:
aLayoutConfig.SetModified();
}
+ sal_Bool IsAlignMathObjectsToBaseline() const { return bIsAlignMathObjectsToBaseline; }
+ void SetAlignMathObjectsToBaseline( sal_Bool bVal, sal_Bool bNoModify = sal_False )
+ {
+ bIsAlignMathObjectsToBaseline = bVal;
+ if(!bNoModify)
+ aLayoutConfig.SetModified();
+ }
};
#endif
diff --git a/sw/source/ui/shells/basesh.cxx b/sw/source/ui/shells/basesh.cxx
index 025403cc08..ee845c932b 100644
--- a/sw/source/ui/shells/basesh.cxx
+++ b/sw/source/ui/shells/basesh.cxx
@@ -1080,6 +1080,14 @@ void SwBaseShell::Execute(SfxRequest &rReq)
rSh.SetFlyFrmAttr(aSet);
}
+ // if new anchor is 'as char' and it is a Math object and the usual
+ // pre-conditions are met then align the formula to the baseline of the text
+ const uno::Reference < embed::XEmbeddedObject > xObj( rSh.GetOleRef() );
+ const bool bDoMathBaselineAlignment = xObj.is() && SotExchange::IsMath( xObj->getClassID() )
+ && FLY_AS_CHAR == eSet && rSh.GetDoc()->get( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT );
+ if (bDoMathBaselineAlignment)
+ rSh.AlignFormulaToBaseline( xObj );
+
USHORT nHtmlMode = ::GetHtmlMode(GetView().GetDocShell());
if( nHtmlMode )
{
diff --git a/sw/source/ui/shells/frmsh.cxx b/sw/source/ui/shells/frmsh.cxx
index b2dfee2fa4..66043b2eb5 100644
--- a/sw/source/ui/shells/frmsh.cxx
+++ b/sw/source/ui/shells/frmsh.cxx
@@ -52,7 +52,7 @@
#include <vcl/msgbox.hxx>
// <--
-
+#include <doc.hxx>
#include <fmturl.hxx>
#include <fmtclds.hxx>
#include <fmtcnct.hxx>
@@ -78,6 +78,7 @@
#include <helpid.h>
#include <cmdid.h>
+#include <cfgitems.hxx>
#include <globals.hrc>
#include <popup.hrc>
#include <shells.hrc>
@@ -408,14 +409,13 @@ void SwFrameShell::Execute(SfxRequest &rReq)
SID_HTML_MODE, SID_HTML_MODE,
FN_SET_FRM_ALT_NAME, FN_SET_FRM_ALT_NAME,
FN_PARAM_CHAIN_PREVIOUS, FN_PARAM_CHAIN_NEXT,
+ FN_OLE_IS_MATH, FN_OLE_IS_MATH,
+ FN_MATH_BASELINE_ALIGNMENT, FN_MATH_BASELINE_ALIGNMENT,
0);
const SwViewOption* pVOpt = rSh.GetViewOptions();
if(nSel & nsSelectionType::SEL_OLE)
- {
- aSet.Put(SfxBoolItem(FN_KEEP_ASPECT_RATIO,
- pVOpt->IsKeepRatio()));
- }
+ aSet.Put( SfxBoolItem(FN_KEEP_ASPECT_RATIO, pVOpt->IsKeepRatio()) );
aSet.Put(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(GetView().GetDocShell())));
aSet.Put(SfxStringItem(FN_SET_FRM_NAME, rSh.GetFlyName()));
if( nSel & nsSelectionType::SEL_OLE )
@@ -446,6 +446,12 @@ void SwFrameShell::Execute(SfxRequest &rReq)
if (rSize.GetHeightPercent() && rSize.GetHeightPercent() != 0xff)
rSize.SetHeight(rSh.GetAnyCurRect(RECT_FLY_EMBEDDED).Height());
+ // disable vertical positioning for Math Objects anchored 'as char' if baseline alignment is activated
+ aSet.Put( SfxBoolItem( FN_MATH_BASELINE_ALIGNMENT,
+ rSh.GetDoc()->get( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT ) ) );
+ const uno::Reference < embed::XEmbeddedObject > xObj( rSh.GetOleRef() );
+ aSet.Put( SfxBoolItem( FN_OLE_IS_MATH, xObj.is() && SotExchange::IsMath( xObj->getClassID() ) ) );
+
UINT16 nDefPage = 0;
if(pArgs && pArgs->GetItemState(FN_FORMAT_FRAME_DLG, FALSE, &pItem) == SFX_ITEM_SET)
nDefPage = ((SfxUInt16Item *)pItem)->GetValue();
@@ -1146,3 +1152,4 @@ void SwFrameShell::StateInsert(SfxItemSet &rSet)
if ((nSel & nsSelectionType::SEL_GRF) || (nSel & nsSelectionType::SEL_OLE))
rSet.DisableItem(FN_INSERT_FRAME);
}
+
diff --git a/sw/source/ui/uiview/swcli.cxx b/sw/source/ui/uiview/swcli.cxx
index 996ab9b235..f3e8b6f2c5 100644
--- a/sw/source/ui/uiview/swcli.cxx
+++ b/sw/source/ui/uiview/swcli.cxx
@@ -27,16 +27,17 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-#include <com/sun/star/embed/NoVisualAreaSizeException.hpp>
+#include <com/sun/star/embed/NoVisualAreaSizeException.hpp>
#include <wrtsh.hxx>
+#include <doc.hxx>
#include <swtypes.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <edtwin.hxx>
#include <swcli.hxx>
+#include <cmdid.h>
+#include <cfgitems.hxx>
#include <toolkit/helper/vclunohelper.hxx>
@@ -169,3 +170,18 @@ void SwOleClient::MakeVisible()
const SwWrtShell &rSh = ((SwView*)GetViewShell())->GetWrtShell();
rSh.MakeObjVisible( GetObject() );
}
+
+// --> #i972#
+void SwOleClient::FormatChanged()
+{
+ const uno::Reference < embed::XEmbeddedObject >& xObj( GetObject() );
+ SwView * pView = dynamic_cast< SwView * >( GetViewShell() );
+ if ( pView && xObj.is() && SotExchange::IsMath( xObj->getClassID() ) )
+ {
+ SwWrtShell & rWrtSh = pView->GetWrtShell();
+ if (rWrtSh.GetDoc()->get( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT ))
+ rWrtSh.AlignFormulaToBaseline( xObj );
+ }
+}
+// <--
+
diff --git a/sw/source/ui/uno/SwXDocumentSettings.cxx b/sw/source/ui/uno/SwXDocumentSettings.cxx
index 36b7d7afd6..b19a36cba5 100755..100644
--- a/sw/source/ui/uno/SwXDocumentSettings.cxx
+++ b/sw/source/ui/uno/SwXDocumentSettings.cxx
@@ -123,7 +123,8 @@ enum SwDocumentSettingsPropertyHandles
// --> OD 2008-06-05 #i89181#
HANDLE_TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST,
// <--
- HANDLE_MODIFYPASSWORDINFO
+ HANDLE_MODIFYPASSWORDINFO,
+ HANDLE_MATH_BASELINE_ALIGNMENT
};
MasterPropertySetInfo * lcl_createSettingsInfo()
@@ -178,6 +179,7 @@ MasterPropertySetInfo * lcl_createSettingsInfo()
// --> OD 2008-06-05 #i89181#
{ RTL_CONSTASCII_STRINGPARAM("TabAtLeftIndentForParagraphsInList"), HANDLE_TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST, CPPUTYPE_BOOLEAN, 0, 0},
{ RTL_CONSTASCII_STRINGPARAM("ModifyPasswordInfo"), HANDLE_MODIFYPASSWORDINFO, CPPUTYPE_PROPERTYVALUE, 0, 0},
+ { RTL_CONSTASCII_STRINGPARAM("MathBaselineAlignment"), HANDLE_MATH_BASELINE_ALIGNMENT, CPPUTYPE_BOOLEAN, 0, 0},
/*
* As OS said, we don't have a view when we need to set this, so I have to
@@ -686,6 +688,12 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
uno::Reference< uno::XInterface >() );
}
break;
+ case HANDLE_MATH_BASELINE_ALIGNMENT:
+ {
+ sal_Bool bTmp = *(sal_Bool*)rValue.getValue();
+ mpDoc->set( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT, bTmp );
+ }
+ break;
default:
throw UnknownPropertyException();
}
@@ -1018,6 +1026,12 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf
rValue <<= mpDocSh->GetModifyPasswordInfo();
}
break;
+ case HANDLE_MATH_BASELINE_ALIGNMENT:
+ {
+ sal_Bool bTmp = mpDoc->get( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT );
+ rValue.setValue( &bTmp, ::getBooleanCppuType() );
+ }
+ break;
default:
throw UnknownPropertyException();
diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx
index 701646f5cd..3e0a2c8ce7 100644
--- a/sw/source/ui/wrtsh/wrtsh1.cxx
+++ b/sw/source/ui/wrtsh/wrtsh1.cxx
@@ -27,6 +27,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
#include <com/sun/star/container/XChild.hpp>
#include <com/sun/star/embed/XVisualObject.hpp>
#include <com/sun/star/embed/EmbedMisc.hpp>
@@ -42,9 +43,7 @@
#include <svx/svdview.hxx>
#include <sot/factory.hxx>
#include <svl/itemiter.hxx>
-#ifndef _SOUND_HXX //autogen
#include <vcl/sound.hxx>
-#endif
#include <tools/bigint.hxx>
#include <sot/storage.hxx>
#include <svtools/insdlg.hxx>
@@ -60,28 +59,21 @@
#include <vcl/graph.hxx>
#include <sfx2/printer.hxx>
#include <unotools/charclass.hxx>
-
#include <comphelper/storagehelper.hxx>
#include <svx/svxdlg.hxx>
#include <svx/extrusionbar.hxx>
#include <svx/fontworkbar.hxx>
+#include <frmfmt.hxx>
#include <fmtftn.hxx>
#include <fmtpdsc.hxx>
-#ifndef _WDOCSH_HXX
#include <wdocsh.hxx>
-#endif
-#ifndef _BASESH_HXX
#include <basesh.hxx>
-#endif
#include <swmodule.hxx>
#include <wrtsh.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
#include <uitool.hxx>
-#ifndef _CMDID_H
#include <cmdid.h>
-#endif
+#include <cfgitems.hxx>
#include <pagedesc.hxx>
#include <frmmgr.hxx>
#include <shellio.hxx>
@@ -89,9 +81,7 @@
#include <swundo.hxx> // fuer Undo-Ids
#include <swcli.hxx>
#include <poolfmt.hxx>
-#ifndef _WVIEW_HXX
#include <wview.hxx>
-#endif
#include <edtwin.hxx>
#include <fmtcol.hxx>
#include <swtable.hxx>
@@ -100,15 +90,12 @@
#include <swdtflvr.hxx>
#include <crsskip.hxx>
#include <doc.hxx>
-#ifndef _WRTSH_HRC
#include <wrtsh.hrc>
-#endif
#include <SwStyleNameMapper.hxx>
#include <sfx2/request.hxx>
#include <paratr.hxx>
#include <ndtxt.hxx>
#include <editeng/acorrcfg.hxx>
-//#include <svx/acorrcfg.hxx>
#include <IMark.hxx>
// -> #111827#
@@ -609,6 +596,11 @@ BOOL SwWrtShell::InsertOleObject( const svt::EmbeddedObjectRef& xRef, SwFlyFrmFm
aFrmMgr.SetSize( aSz );
SwFlyFrmFmt *pFmt = SwFEShell::InsertObject( xRef, &aFrmMgr.GetAttrSet() );
+ // --> #i972#
+ if ( bStarMath && pDoc->get( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT ) )
+ AlignFormulaToBaseline( xRef.GetObject() );
+ // <--
+
if (pFlyFrmFmt)
*pFlyFrmFmt = pFmt;
@@ -769,6 +761,8 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
if ( (embed::EmbedMisc::EMBED_ACTIVATEIMMEDIATELY & nMisc) || bLinkingChart
// TODO/LATER: ResizeOnPrinterChange
//|| SVOBJ_MISCSTATUS_RESIZEONPRINTERCHANGE & xObj->GetMiscStatus()
+ || nMisc & embed::EmbedMisc::EMBED_NEVERRESIZE // non-resizable objects need to be
+ // set the size back by this method
)
{
pCli = new SwOleClient( &GetView(), &GetView().GetEditWin(), xObj );
@@ -879,6 +873,17 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
if ( bUseObjectSize )
{
+ // --> this moves non-resizable object so that when adding borders the baseline remains the same
+ const SwFlyFrmFmt *pFlyFrmFmt = dynamic_cast< const SwFlyFrmFmt * >( GetFlyFrmFmt() );
+ ASSERT( pFlyFrmFmt, "Could not find fly frame." );
+ if ( pFlyFrmFmt )
+ {
+ const Point &rPoint = pFlyFrmFmt->GetLastFlyFrmPrtRectPos();
+ SwRect aRect( pFlyPrtRect ? *pFlyPrtRect
+ : GetAnyCurRect( RECT_FLY_PRT_EMBEDDED, 0, xObj.GetObject() ));
+ aArea += rPoint - aRect.Pos(); // adjust area by diff of printing area position in order to keep baseline alignment correct.
+ }
+ // <--
aArea.Width ( _aVisArea.Width() );
aArea.Height( _aVisArea.Height() );
RequestObjectResize( aArea, xObj.GetObject() );
@@ -1864,3 +1869,4 @@ String SwWrtShell::GetSelDescr() const
return aResult;
}
+