summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/IDocumentSettingAccess.hxx5
-rw-r--r--sw/inc/cmdid.h3
-rw-r--r--sw/inc/doc.hxx3
-rw-r--r--sw/inc/fesh.hxx4
-rw-r--r--sw/inc/frmfmt.hxx10
-rw-r--r--sw/inc/ndole.hxx3
-rw-r--r--sw/inc/swabstdlg.hxx3
-rw-r--r--sw/source/core/doc/doc.cxx6
-rw-r--r--sw/source/core/doc/docnew.cxx1
-rw-r--r--sw/source/core/draw/dview.cxx10
-rw-r--r--sw/source/core/frmedt/fefly1.cxx30
-rw-r--r--sw/source/core/frmedt/feshview.cxx29
-rw-r--r--sw/source/core/inc/flyfrm.hxx13
-rw-r--r--sw/source/core/inc/flyfrms.hxx5
-rw-r--r--sw/source/core/inc/layfrm.hxx6
-rw-r--r--sw/source/core/layout/fly.cxx14
-rw-r--r--sw/source/core/layout/flyincnt.cxx9
-rw-r--r--sw/source/core/layout/ssfrm.cxx13
-rw-r--r--sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx6
-rw-r--r--sw/source/core/ole/ndole.cxx4
-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--[-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
-rw-r--r--sw/source/ui/dialog/swdlgfact.hxx2
-rw-r--r--sw/source/ui/frmdlg/frmdlg.cxx3
-rw-r--r--sw/source/ui/frmdlg/frmpage.cxx40
-rw-r--r--sw/source/ui/inc/frmdlg.hxx3
-rw-r--r--sw/source/ui/inc/frmpage.hxx17
-rw-r--r--sw/source/ui/inc/optpage.hxx11
-rw-r--r--sw/source/ui/shells/frmsh.cxx18
-rw-r--r--sw/source/ui/uiview/swcli.cxx21
-rwxr-xr-xsw/source/ui/uno/SwXDocumentSettings.cxx16
-rw-r--r--sw/source/ui/wrtsh/wrtsh1.cxx29
38 files changed, 349 insertions, 269 deletions
diff --git a/sw/inc/IDocumentSettingAccess.hxx b/sw/inc/IDocumentSettingAccess.hxx
index 6be53158ddc8..0f11b4569795 100644
--- a/sw/inc/IDocumentSettingAccess.hxx
+++ b/sw/inc/IDocumentSettingAccess.hxx
@@ -89,7 +89,8 @@ namespace com { namespace sun { namespace star { namespace i18n { struct Forbidd
GLOBAL_DOCUMENT_SAVE_LINKS,
LABEL_DOCUMENT,
PURGE_OLE,
- KERN_ASIAN_PUNCTUATION
+ KERN_ASIAN_PUNCTUATION,
+ MATH_BASELINE_ALIGNMENT
};
public:
@@ -209,4 +210,4 @@ protected:
virtual ~IDocumentSettingAccess() {};
};
- #endif // IDOCUMENTSETTINGACCESS_HXX_INCLUDED
+ #endif // IDOCUMENTSETTINGACCESS_HXX_INCLUDED \ No newline at end of file
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index a206392aad3b..2b0e1542b882 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -908,6 +908,9 @@ Achtung: Ab sofort sind in diesem File keine C++-Kommentare (//) mehr
#define FN_UNO_META (FN_EXTRA2 + 112)
#define FN_UNO_NESTED_TEXT_CONTENT (FN_EXTRA2 + 113)
+// #i972: bool items to be passed to SwFrmPage for evaluation
+#define FN_OLE_IS_MATH (FN_EXTRA2 + 114)
+#define FN_MATH_BASELINE_ALIGNMENT (FN_EXTRA2 + 115)
/*--------------------------------------------------------------------
Bereich: Hilfe
--------------------------------------------------------------------*/
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 1e26b0f0e2bd..9d47679260c5 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -588,6 +588,7 @@ private:
bool mbUseFormerTextWrapping : 1; // FME 2005-05-11 #108724#
bool mbConsiderWrapOnObjPos : 1; // OD 2004-05-05 #i28701#
// TRUE: object positioning algorithm has consider the wrapping style of // the floating screen objects as given by its attribute 'WrapInfluenceOnObjPos'
+ bool mbMathBaselineAlignment : 1; // TL 2010-10-29 #i972#
// non-ui-compatibility flags:
bool mbOldNumbering : 1; // HBRINKM #111955#
@@ -2220,4 +2221,4 @@ namespace docfunc
bool HasOutlineStyleToBeWrittenAsNormalListStyle( SwDoc& rDoc );
}
// <--
-#endif //_DOC_HXX
+#endif //_DOC_HXX \ No newline at end of file
diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx
index 9480e03ab62a..873b28225204 100644
--- a/sw/inc/fesh.hxx
+++ b/sw/inc/fesh.hxx
@@ -29,6 +29,7 @@
#include <com/sun/star/text/RelOrientation.hpp>
#include <com/sun/star/embed/XClassifiedObject.hpp>
+#include <com/sun/star/embed/XEmbeddedObject.hpp>
#include <svx/svdobj.hxx>
#include "swdllapi.h"
@@ -435,6 +436,9 @@ public:
void SetFlyName( const String& rName );
const String& GetFlyName() const;
+ // get reference to OLE object (if there is one) for selected FlyFrame
+ const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > GetOleRef() const;
+
// erezeuge eindeutige Namen fuer Rahmen
String GetUniqueGrfName() const;
String GetUniqueOLEName() const;
diff --git a/sw/inc/frmfmt.hxx b/sw/inc/frmfmt.hxx
index 388607d4f0e0..4829775cf0fb 100644
--- a/sw/inc/frmfmt.hxx
+++ b/sw/inc/frmfmt.hxx
@@ -32,6 +32,7 @@
// <--
#include <cppuhelper/weakref.hxx>
+#include <tools/gen.hxx>
#include <format.hxx>
@@ -153,6 +154,12 @@ class SW_DLLPUBLIC SwFlyFrmFmt: public SwFrmFmt
{
friend class SwDoc;
+ // #i972:
+ // it stores the previous position of Prt rectangle from RequestObjectResize
+ // so it can be used to move frames of non-resizable objects to align them correctly
+ // when they get borders (this is done in SwWrtShell::CalcAndGetScale)
+ Point m_aLastFlyFrmPrtRectPos;
+
//Beide nicht vorhanden.
SwFlyFrmFmt( const SwFlyFrmFmt &rCpy );
SwFlyFrmFmt &operator=( const SwFlyFrmFmt &rCpy );
@@ -219,6 +226,9 @@ public:
*/
sal_Bool IsBackgroundBrushInherited() const;
+ const Point & GetLastFlyFrmPrtRectPos() const { return m_aLastFlyFrmPrtRectPos; }
+ void SetLastFlyFrmPrtRectPos( const Point &rPoint ) { m_aLastFlyFrmPrtRectPos = rPoint; }
+
DECL_FIXEDMEMPOOL_NEWDEL(SwFlyFrmFmt)
};
diff --git a/sw/inc/ndole.hxx b/sw/inc/ndole.hxx
index 631dd88f78c5..e439109ff866 100644
--- a/sw/inc/ndole.hxx
+++ b/sw/inc/ndole.hxx
@@ -67,7 +67,7 @@ public:
String GetDescription();
#ifndef _FESHVIEW_ONLY_INLINE_NEEDED
- com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > GetOleRef();
+ const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject > GetOleRef();
svt::EmbeddedObjectRef& GetObject();
const String& GetCurrentPersistName() const { return aName; }
BOOL IsOleRef() const; //Damit das Objekt nicht unnoetig geladen werden muss.
@@ -168,4 +168,3 @@ inline const SwOLENode *SwNode::GetOLENode() const
}
#endif // _NDOLE_HXX
-
diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx
index d189f3c31349..d6ec631d3b94 100644
--- a/sw/inc/swabstdlg.hxx
+++ b/sw/inc/swabstdlg.hxx
@@ -494,5 +494,4 @@ public:
virtual CreateTabPage GetTabPageCreatorFunc( USHORT nId ) = 0;
virtual GetTabPageRanges GetTabPageRangesFunc( USHORT nId ) = 0;
};
-#endif
-
+#endif \ No newline at end of file
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index 2df835f06c12..9119853634c7 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -207,6 +207,7 @@ bool SwDoc::get(/*[in]*/ DocumentSettingId id) const
case PURGE_OLE: return mbPurgeOLE;
case KERN_ASIAN_PUNCTUATION: return mbKernAsianPunctuation;
case DO_NOT_RESET_PARA_ATTRS_FOR_NUM_FONT: return mbDoNotResetParaAttrsForNumFont;
+ case MATH_BASELINE_ALIGNMENT: return mbMathBaselineAlignment;
default:
ASSERT(false, "Invalid setting id");
}
@@ -305,7 +306,7 @@ void SwDoc::set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value)
case UNIX_FORCE_ZERO_EXT_LEADING:
mbUnixForceZeroExtLeading = value;
break;
- case PROTECT_FORM:
+ case PROTECT_FORM:
mbProtectForm = value;
break;
@@ -346,6 +347,9 @@ void SwDoc::set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value)
case DO_NOT_RESET_PARA_ATTRS_FOR_NUM_FONT:
mbDoNotResetParaAttrsForNumFont = value;
break;
+ case MATH_BASELINE_ALIGNMENT:
+ mbMathBaselineAlignment = value;
+ break;
default:
ASSERT(false, "Invalid setting id");
}
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index 1b3d5fe6eb55..57e3f070b56e 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -366,6 +366,7 @@ SwDoc::SwDoc() :
mbUseFormerObjectPos = aOptions.IsUseObjectPositioning();
mbUseFormerTextWrapping = aOptions.IsUseOurTextWrapping();
mbConsiderWrapOnObjPos = aOptions.IsConsiderWrappingStyle();
+ mbMathBaselineAlignment = false; // default for *old* documents is 'off'
mbAddFlyOffsets = false; // hidden
mbOldNumbering = false; // hidden
mbUseHiResolutionVirtualDevice = true; // hidden
diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx
index f7242d1d8132..441b474c6b27 100644
--- a/sw/source/core/draw/dview.cxx
+++ b/sw/source/core/draw/dview.cxx
@@ -32,6 +32,7 @@
#include <editeng/protitem.hxx>
#include <svx/svdpagv.hxx>
#include <svx/fmmodel.hxx>
+#include <sot/exchange.hxx>
#include "swtypes.hxx"
#include "pagefrm.hxx"
@@ -991,6 +992,14 @@ void SwDrawView::CheckPossibilities()
bSzProtect |= ( embed::EmbedMisc::EMBED_NEVERRESIZE & xObj->getStatus( embed::Aspects::MSOLE_CONTENT ) ) ? TRUE : FALSE;
// <--
+
+ // #i972: protect position if it is a Math object anchored 'as char' and baseline alignment is activated
+ SwDoc* pDoc = Imp().GetShell()->GetDoc();
+ const bool bProtectMathPos = SotExchange::IsMath( xObj->getClassID() )
+ && FLY_AS_CHAR == pFly->GetFmt()->GetAnchor().GetAnchorId()
+ && pDoc->get( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT );
+ if (bProtectMathPos)
+ bMoveProtect = true;
}
}
}
@@ -1112,4 +1121,3 @@ const SdrMarkList& SwDrawView::GetMarkedObjectList() const
-
diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index 59e362a64964..e4d4f2e9b399 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -27,6 +27,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
#include <hintids.hxx>
#include <svl/itemiter.hxx>
#include <svtools/imapobj.hxx>
@@ -69,6 +70,8 @@
#include <fldbas.hxx>
#include <fmtfld.hxx>
#include <swundo.hxx>
+#include <frame.hxx>
+#include <notxtfrm.hxx>
// --> OD 2006-03-06 #125892#
#include <HandleAnchorNodeChg.hxx>
// <--
@@ -1526,7 +1529,10 @@ Size SwFEShell::RequestObjectResize( const SwRect &rRect, const uno::Reference <
}
}
- pFly->SetLastFlyFrmPrtRectPos( pFly->Prt().Pos() ); //stores the value of last Prt rect
+ SwFlyFrmFmt *pFlyFrmFmt = pFly->GetFmt();
+ ASSERT( pFlyFrmFmt, "fly frame format missing!" );
+ if ( pFlyFrmFmt )
+ pFlyFrmFmt->SetLastFlyFrmPrtRectPos( pFly->Prt().Pos() ); //stores the value of last Prt rect
EndAllAction();
@@ -1593,6 +1599,20 @@ const String& SwFEShell::GetFlyName() const
}
+const uno::Reference < embed::XEmbeddedObject > SwFEShell::GetOleRef() const
+{
+ uno::Reference < embed::XEmbeddedObject > xObj;
+ SwFlyFrm * pFly = FindFlyFrm();
+ if (pFly && pFly->Lower() && pFly->Lower()->IsNoTxtFrm())
+ {
+ SwOLENode *pNd = ((SwNoTxtFrm*)pFly->Lower())->GetNode()->GetOLENode();
+ if (pNd)
+ xObj = pNd->GetOLEObj().GetOleRef();
+ }
+ return xObj;
+}
+
+
String SwFEShell::GetUniqueGrfName() const
{
return GetDoc()->GetUniqueGrfName();
@@ -2203,10 +2223,12 @@ void SwFEShell::AlignFormulaToBaseline( const uno::Reference < embed::XEmbeddedO
const MapMode aTargetMapMode( MAP_TWIP );
nBaseline = OutputDevice::LogicToLogic( nBaseline, aSourceMapMode.GetMapUnit(), aTargetMapMode.GetMapUnit() );
- //TLMATH01 ??? is nBaseline really always > 0 ?
ASSERT( nBaseline > 0, "Wrong value of Baseline while retrieving from Starmath!" );
//nBaseline must be moved by aPrt position
- nBaseline += pFly->GetLastFlyFrmPrtRectPos().Y();
+ const SwFlyFrmFmt *pFlyFrmFmt = pFly->GetFmt();
+ ASSERT( pFlyFrmFmt, "fly frame format missing!" );
+ if ( pFlyFrmFmt )
+ nBaseline += pFlyFrmFmt->GetLastFlyFrmPrtRectPos().Y();
const SwFmtVertOrient &rVert = pFrmFmt->GetVertOrient();
SwFmtVertOrient aVert( rVert );
@@ -2247,5 +2269,3 @@ void SwFEShell::AlignAllFormulasToBaseline()
EndAllAction();
}
-
-
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index f334ddcaee2f..3d8b8b79840a 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -27,7 +27,9 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+
#include <com/sun/star/embed/EmbedMisc.hpp>
+
#include "hintids.hxx"
#include <svx/sdrobjectfilter.hxx>
@@ -48,9 +50,9 @@
#include <svx/svdpage.hxx>
#include <svx/svdpagv.hxx>
-#ifndef _POOLFMT_HRC
+#include <IDocumentSettingAccess.hxx>
+#include <cmdid.h>
#include <poolfmt.hrc> // fuer InitFldTypes
-#endif
#include <frmfmt.hxx>
#include <frmatr.hxx>
#include <fmtfsize.hxx>
@@ -2573,26 +2575,32 @@ BYTE SwFEShell::IsSelObjProtected( USHORT eType ) const
nChk |= ( pObj->IsMoveProtect() ? FLYPROTECT_POS : 0 ) |
( pObj->IsResizeProtect()? FLYPROTECT_SIZE : 0 );
- if( FLYPROTECT_CONTENT & eType && pObj->ISA(SwVirtFlyDrawObj) )
+ if( pObj->ISA(SwVirtFlyDrawObj) )
{
SwFlyFrm *pFly = ((SwVirtFlyDrawObj*)pObj)->GetFlyFrm();
- if ( pFly->GetFmt()->GetProtect().IsCntntProtected() )
+ if ( (FLYPROTECT_CONTENT & eType) && pFly->GetFmt()->GetProtect().IsCntntProtected() )
nChk |= FLYPROTECT_CONTENT;
if ( pFly->Lower() && pFly->Lower()->IsNoTxtFrm() )
{
SwOLENode *pNd = ((SwCntntFrm*)pFly->Lower())->GetNode()->GetOLENode();
- if ( pNd )
+ uno::Reference < embed::XEmbeddedObject > xObj( pNd ? pNd->GetOLEObj().GetOleRef() : 0 );
+ if ( xObj.is() )
{
- uno::Reference < embed::XEmbeddedObject > xObj = pNd->GetOLEObj().GetOleRef();
-
// TODO/LATER: use correct aspect
- if ( xObj.is() &&
- embed::EmbedMisc::EMBED_NEVERRESIZE & xObj->getStatus( embed::Aspects::MSOLE_CONTENT ) )
+ const bool bNeverResize = (embed::EmbedMisc::EMBED_NEVERRESIZE & xObj->getStatus( embed::Aspects::MSOLE_CONTENT ));
+ if ( (FLYPROTECT_CONTENT & eType) && bNeverResize )
{
nChk |= FLYPROTECT_SIZE;
nChk |= FLYPROTECT_FIXED;
}
+
+ // set FLYPROTECT_POS if it is a Math object anchored 'as char' and baseline alignment is activated
+ const bool bProtectMathPos = SotExchange::IsMath( xObj->getClassID() )
+ && FLY_AS_CHAR == pFly->GetFmt()->GetAnchor().GetAnchorId()
+ && pDoc->get( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT );
+ if ((FLYPROTECT_POS & eType) && bProtectMathPos)
+ nChk |= FLYPROTECT_POS;
}
}
}
@@ -3233,5 +3241,4 @@ Point SwFEShell::GetRelativePagePosition(const Point& rDocPos)
aRet = rDocPos - pPage->Frm().TopLeft();
}
return aRet;
-}
-
+} \ No newline at end of file
diff --git a/sw/source/core/inc/flyfrm.hxx b/sw/source/core/inc/flyfrm.hxx
index f7e73131ea4d..5021f684346f 100644
--- a/sw/source/core/inc/flyfrm.hxx
+++ b/sw/source/core/inc/flyfrm.hxx
@@ -28,9 +28,9 @@
#define _FLYFRM_HXX
#include "layfrm.hxx"
+#include "frmfmt.hxx"
class SwPageFrm;
-class SwFlyFrmFmt;
class SwFmtFrmSize;
struct SwCrsrMoveState;
class SwBorderAttrs;
@@ -77,9 +77,6 @@ protected:
// OD 2004-05-27 #i26791# - moved to <SwAnchoredObject>
// Point aRelPos; //Die Relative Position zum Master
- Point aLastFlyFrmPrtRectPos; // it stores the previous position of Prt rectangle from RequestObjectResize
- // so it can be used to move frames of non-resizable objects to align them correctly
- // when they get borders (this is done in SwWrtShell::CalcAndGetScale)
private:
BOOL bLocked :1; //Cntnt-gebundene Flys muessen derart blockiert werden
@@ -287,8 +284,10 @@ public:
*/
virtual bool IsFormatPossible() const;
- const Point GetLastFlyFrmPrtRectPos() const { return aLastFlyFrmPrtRectPos; }
- void SetLastFlyFrmPrtRectPos( Point aPoint ) { aLastFlyFrmPrtRectPos = aPoint; }
-
+ // overwriting "SwFrmFmt *SwLayoutFrm::GetFmt" to provide the correct derived return type.
+ // (This is in order to skip on the otherwise necessary casting of the result to
+ // 'SwFlyFrmFmt *' after calls to this function. The casting is now done in this function.)
+ virtual const SwFlyFrmFmt *GetFmt() const;
+ virtual SwFlyFrmFmt *GetFmt();
};
#endif
diff --git a/sw/source/core/inc/flyfrms.hxx b/sw/source/core/inc/flyfrms.hxx
index 2f81d55cffae..c73a310f835a 100644
--- a/sw/source/core/inc/flyfrms.hxx
+++ b/sw/source/core/inc/flyfrms.hxx
@@ -188,7 +188,6 @@ class SwFlyInCntFrm : public SwFlyFrm
BOOL bInvalidLayout :1;
BOOL bInvalidCntnt :1;
- bool bPosCalculated;
protected:
virtual void NotifyBackground( SwPageFrm *pPage,
@@ -238,8 +237,6 @@ public:
// format of the anchor frame
virtual void _ActionOnInvalidation( const InvalidationType _nInvalid );
// <--
-
- void SetPosCalculated( bool bNew ) { bPosCalculated = bNew; }
};
inline void SwFlyInCntFrm::InvalidateLayout() const
@@ -259,4 +256,4 @@ inline void SwFlyInCntFrm::ValidateCntnt() const
((SwFlyInCntFrm*)this)->bInvalidCntnt = FALSE;
}
-#endif
+#endif \ No newline at end of file
diff --git a/sw/source/core/inc/layfrm.hxx b/sw/source/core/inc/layfrm.hxx
index 28216e326b41..0917860ddaa0 100644
--- a/sw/source/core/inc/layfrm.hxx
+++ b/sw/source/core/inc/layfrm.hxx
@@ -123,9 +123,9 @@ public:
// <--
BOOL IsAnLower( const SwFrm * ) const;
- const SwFrmFmt *GetFmt() const { return (const SwFrmFmt*)GetDep(); }
- SwFrmFmt *GetFmt() { return (SwFrmFmt*)GetDep(); }
- void SetFrmFmt( SwFrmFmt* );
+ virtual const SwFrmFmt *GetFmt() const;
+ virtual SwFrmFmt *GetFmt();
+ void SetFrmFmt( SwFrmFmt* );
//Verschieben der Ftns aller Lower - ab dem StartCntnt.
//TRUE wenn mindestens eine Ftn verschoben wurde.
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index 2347810d8b30..712d917ea385 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -122,7 +122,6 @@ SwFlyFrm::SwFlyFrm( SwFlyFrmFmt *pFmt, SwFrm *pAnch ) :
// aRelPos(),
pPrevLink( 0 ),
pNextLink( 0 ),
- aLastFlyFrmPrtRectPos(),
bInCnt( FALSE ),
bAtCnt( FALSE ),
bLayout( FALSE ),
@@ -1274,6 +1273,7 @@ void SwFlyFrm::ChgRelPos( const Point &rNewPos )
aHori.SetPos( nTmpX );
aSet.Put( aHori );
}
+ SetCurrRelPos( rNewPos );
pFmt->GetDoc()->SetAttr( aSet, *pFmt );
}
}
@@ -2852,3 +2852,15 @@ bool SwFlyFrm::IsFormatPossible() const
return SwAnchoredObject::IsFormatPossible() &&
!IsLocked() && !IsColLocked();
}
+
+const SwFlyFrmFmt * SwFlyFrm::GetFmt() const
+{
+ return static_cast< const SwFlyFrmFmt * >( GetDep() );
+}
+
+SwFlyFrmFmt * SwFlyFrm::GetFmt()
+{
+ return static_cast< SwFlyFrmFmt * >( GetDep() );
+}
+
+ \ No newline at end of file
diff --git a/sw/source/core/layout/flyincnt.cxx b/sw/source/core/layout/flyincnt.cxx
index 91602dc6a8b9..0bdecad9d16e 100644
--- a/sw/source/core/layout/flyincnt.cxx
+++ b/sw/source/core/layout/flyincnt.cxx
@@ -56,7 +56,6 @@ SwFlyInCntFrm::SwFlyInCntFrm( SwFlyFrmFmt *pFmt, SwFrm *pAnch ) :
SwFlyFrm( pFmt, pAnch )
{
bInCnt = bInvalidLayout = bInvalidCntnt = TRUE;
- bPosCalculated = FALSE;
SwTwips nRel = pFmt->GetVertOrient().GetPos();
// OD 2004-05-27 #i26791# - member <aRelPos> moved to <SwAnchoredObject>
Point aRelPos;
@@ -204,12 +203,6 @@ void SwFlyInCntFrm::MakeObjPos()
if ( !bValidPos )
{
bValidPos = TRUE;
- // --> let the position be set, only if it was calculated in
- // SwAsCharAnchoredObjectPosition::CalcPosition
- //TLMATH01_ ????
- if ( !bPosCalculated )
- return;
- // <--
SwFlyFrmFmt *pFmt = (SwFlyFrmFmt*)GetFmt();
const SwFmtVertOrient &rVert = pFmt->GetVertOrient();
//Und ggf. noch die aktuellen Werte im Format updaten, dabei darf
@@ -364,4 +357,4 @@ void SwFlyInCntFrm::MakeAll()
// <--
}
Unlock();
-}
+} \ No newline at end of file
diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx
index 9b3ff15666f9..c0cef39294b8 100644
--- a/sw/source/core/layout/ssfrm.cxx
+++ b/sw/source/core/layout/ssfrm.cxx
@@ -414,6 +414,19 @@ SwFrm::~SwFrm()
#endif
}
+/*************************************************************************/
+
+const SwFrmFmt * SwLayoutFrm::GetFmt() const
+{
+ return static_cast< const SwFlyFrmFmt * >( GetDep() );
+}
+
+SwFrmFmt * SwLayoutFrm::GetFmt()
+{
+ return static_cast< SwFlyFrmFmt * >( GetDep() );
+}
+
+
/*************************************************************************
|*
|* SwLayoutFrm::SetFrmFmt()
diff --git a/sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx b/sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx
index 9b63e7423e3d..cc9b42a970c9 100644
--- a/sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx
@@ -328,11 +328,7 @@ void SwAsCharAnchoredObjectPosition::CalcPosition()
{
// set new anchor position and relative position
SwFlyInCntFrm* pFlyInCntFrm = &(const_cast<SwFlyInCntFrm&>(rFlyInCntFrm));
- // --> let SwFlyInCnt::MakeObjPos set position only at this place using bPosCalculated
- pFlyInCntFrm->SetPosCalculated( TRUE );
pFlyInCntFrm->SetRefPoint( aAnchorPos, aRelAttr, aRelPos );
- pFlyInCntFrm->SetPosCalculated( FALSE );
- // <--
if( nObjWidth != (pFlyInCntFrm->Frm().*fnRect->fnGetWidth)() )
{
// recalculate object bound rectangle, if object width has changed.
@@ -458,4 +454,4 @@ SwRect SwAsCharAnchoredObjectPosition::GetObjBoundRectInclSpacing() const
sal_uInt8 SwAsCharAnchoredObjectPosition::GetLineAlignment() const
{
return mnLineAlignment;
-}
+} \ No newline at end of file
diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx
index 881402efbfb2..499edd7a9721 100644
--- a/sw/source/core/ole/ndole.cxx
+++ b/sw/source/core/ole/ndole.cxx
@@ -781,7 +781,7 @@ BOOL SwOLEObj::IsOleRef() const
return xOLERef.is();
}
-uno::Reference < embed::XEmbeddedObject > SwOLEObj::GetOleRef()
+const uno::Reference < embed::XEmbeddedObject > SwOLEObj::GetOleRef()
{
if( !xOLERef.is() )
{
@@ -1015,4 +1015,4 @@ void SwOLELRUCache::RemoveObj( SwOLEObj& rObj )
SvPtrarr::Remove( nPos );
if( !Count() )
DELETEZ( pOLELRU_Cache );
-}
+} \ No newline at end of file
diff --git a/sw/source/ui/app/appopt.cxx b/sw/source/ui/app/appopt.cxx
index c6e2527ba0c8..485625be0e69 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)
+ {
+ 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 c201109ca1cb..98fe7316ecd5 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 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",
}
diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx
index 5d8611d51f54..5bd28c3a1716 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 740d31c5e88c..a986659b857c 100644
--- a/sw/source/ui/frmdlg/frmdlg.cxx
+++ b/sw/source/ui/frmdlg/frmdlg.cxx
@@ -93,6 +93,7 @@ SwFrmDlg::SwFrmDlg( SfxViewFrame* pViewFrame,
aTmp += *pStr;
aTmp += ')';
}
+
AddTabPage(TP_FRM_STD, SwFrmPage::Create, 0);
AddTabPage(TP_FRM_ADD, SwFrmAddPage::Create, 0);
AddTabPage(TP_FRM_WRAP, SwWrapTabPage::Create, 0);
@@ -216,4 +217,4 @@ void SwFrmDlg::PageCreated( USHORT nId, SfxTabPage &rPage )
}
break;
}
-}
+} \ No newline at end of file
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index 5bff86b1a4c7..7f9c74169fe2 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( false )
{
FreeResource();
SetExchangeSupport();
@@ -785,6 +788,11 @@ void SwFrmPage::Reset( const SfxItemSet &rSet )
const SwFmtAnchor& rAnchor = (const SwFmtAnchor&)rSet.Get(RES_ANCHOR);
+ m_bIsMathOLE = ((const SfxBoolItem&)rSet.Get( FN_OLE_IS_MATH )).GetValue();
+ m_bIsMathBaselineAlignment = ((const SfxBoolItem&)rSet.Get( FN_MATH_BASELINE_ALIGNMENT )).GetValue();
+ EnableVerticalPositioning( !(m_bIsMathOLE && m_bIsMathBaselineAlignment
+ && FLY_AS_CHAR == rAnchor.GetAnchorId()) );
+
if (bFormat)
{
// Bei Formaten keine Ankerbearbeitung
@@ -1280,8 +1288,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 +1496,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 +1860,10 @@ IMPL_LINK( SwFrmPage, AnchorTypeHdl, RadioButton *, EMPTYARG )
PosHdl(&aHorizontalDLB);
PosHdl(&aVerticalDLB);
}
+
+ EnableVerticalPositioning( !(m_bIsMathOLE && m_bIsMathBaselineAlignment
+ && FLY_AS_CHAR == eId) );
+
return 0;
}
@@ -1875,7 +1889,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 +2318,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 +3273,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 5776cc9f3dd8..a1f16874bc3e 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;
@@ -63,4 +64,4 @@ public:
};
-#endif // _FRMDLG_HXX
+#endif // _FRMDLG_HXX \ No newline at end of file
diff --git a/sw/source/ui/inc/frmpage.hxx b/sw/source/ui/inc/frmpage.hxx
index 219f6c37a308..918a7042675c 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
@@ -341,4 +336,4 @@ public:
};
-#endif // _FRMPAGE_HXX
+#endif // _FRMPAGE_HXX \ No newline at end of file
diff --git a/sw/source/ui/inc/optpage.hxx b/sw/source/ui/inc/optpage.hxx
index d05e68588b2d..61b8056aa309 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/shells/frmsh.cxx b/sw/source/ui/shells/frmsh.cxx
index 5d972af52f72..b2b846d97b6e 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();
@@ -1145,4 +1151,4 @@ void SwFrameShell::StateInsert(SfxItemSet &rSet)
if ((nSel & nsSelectionType::SEL_GRF) || (nSel & nsSelectionType::SEL_OLE))
rSet.DisableItem(FN_INSERT_FRAME);
-}
+} \ No newline at end of file
diff --git a/sw/source/ui/uiview/swcli.cxx b/sw/source/ui/uiview/swcli.cxx
index 6f5288cc8c27..4265f3cf8cd0 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>
@@ -173,16 +174,14 @@ void SwOleClient::MakeVisible()
// --> #i972#
void SwOleClient::FormatChanged()
{
- const uno::Reference < embed::XEmbeddedObject >& xObj = GetObject();
-
- SvGlobalName aCLSID( xObj->getClassID() );
- if ( SotExchange::IsMath( aCLSID ) )
+ const uno::Reference < embed::XEmbeddedObject >& xObj( GetObject() );
+ SwView * pView = dynamic_cast< SwView * >( GetViewShell() );
+ if ( pView && xObj.is() && SotExchange::IsMath( xObj->getClassID() ) )
{
- SwView * pView = dynamic_cast< SwView * >( GetViewShell() );
- if (pView)
- pView->GetWrtShell().AlignFormulaToBaseline( xObj );
+ 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 a3ef96d1a613..9b847644234f 100755
--- 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 583013132458..b40ae3e4379f 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>
@@ -58,13 +59,11 @@
#include <vcl/graph.hxx>
#include <sfx2/printer.hxx>
#include <unotools/charclass.hxx>
-
-#include <../../core/inc/flyfrm.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>
#include <wdocsh.hxx>
@@ -74,6 +73,7 @@
#include <view.hxx>
#include <uitool.hxx>
#include <cmdid.h>
+#include <cfgitems.hxx>
#include <pagedesc.hxx>
#include <frmmgr.hxx>
#include <shellio.hxx>
@@ -480,8 +480,7 @@ void SwWrtShell::InsertObject( const svt::EmbeddedObjectRef& xRef, SvGlobalName
if ( xObj.is() )
{
- BOOL bActivate2 = InsertOleObject( xObj );
- if( bActivate && bDoVerb )
+ if( InsertOleObject( xObj ) && bActivate && bDoVerb )
{
SfxInPlaceClient* pClient = GetView().FindIPClient( xObj.GetObject(), &GetView().GetEditWin() );
if ( !pClient )
@@ -505,8 +504,7 @@ void SwWrtShell::InsertObject( const svt::EmbeddedObjectRef& xRef, SvGlobalName
//#50270# Error brauchen wir nicht handeln, das erledigt das
//DoVerb in der SfxViewShell
- if ( bActivate2 )
- pClient->DoVerb( SVVERB_SHOW );
+ pClient->DoVerb( SVVERB_SHOW );
// TODO/LATER: set document name - should be done in Client
//if ( !ERRCODE_TOERROR( nErr ) )
@@ -604,7 +602,7 @@ BOOL SwWrtShell::InsertOleObject( const svt::EmbeddedObjectRef& xRef, SwFlyFrmFm
SwFlyFrmFmt *pFmt = SwFEShell::InsertObject( xRef, &aFrmMgr.GetAttrSet() );
// --> #i972#
- if ( bStarMath ) //sets baseline
+ if ( bStarMath && pDoc->get( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT ) )
AlignFormulaToBaseline( xRef.GetObject() );
// <--
@@ -881,17 +879,14 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
if ( bUseObjectSize )
{
// --> this moves non-resizable object so that when adding borders the baseline remains the same
- const SwFlyFrm *pFly = GetCurrFlyFrm();
- if ( pFly )
+ const SwFlyFrmFmt *pFlyFrmFmt = dynamic_cast< const SwFlyFrmFmt * >( GetFlyFrmFmt() );
+ ASSERT( pFlyFrmFmt, "Could not find fly frame." );
+ if ( pFlyFrmFmt )
{
- const Point aPoint = pFly->GetLastFlyFrmPrtRectPos();
+ const Point &rPoint = pFlyFrmFmt->GetLastFlyFrmPrtRectPos();
SwRect aRect( pFlyPrtRect ? *pFlyPrtRect
: GetAnyCurRect( RECT_FLY_PRT_EMBEDDED, 0, xObj.GetObject() ));
- aArea += aPoint - aRect.Pos();
- }
- else
- {
- ASSERT( FALSE , "Could not find fly frame." );
+ aArea += rPoint - aRect.Pos(); // adjust area by diff of printing area position in order to keep baseline alignment correct.
}
// <--
aArea.Width ( _aVisArea.Width() );
@@ -1878,4 +1873,4 @@ String SwWrtShell::GetSelDescr() const
}
return aResult;
-}
+} \ No newline at end of file