summaryrefslogtreecommitdiff
path: root/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx')
-rw-r--r--sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx14
1 files changed, 10 insertions, 4 deletions
diff --git a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
index b4102c073e70..e4a199695fd8 100644
--- a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
@@ -36,6 +36,9 @@
#include <sectfrm.hxx>
// #i26945#
#include <tabfrm.hxx>
+#include "rootfrm.hxx"
+#include "viewopt.hxx"
+#include "viewsh.hxx"
#include <frmfmt.hxx>
#include <IDocumentSettingAccess.hxx>
#include <fmtsrnd.hxx>
@@ -157,10 +160,13 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
// declare and set <bBrowse> to true, if document is in browser mode and
// object is anchored at the body, but not at frame belonging to a table.
- const bool bBrowse = GetAnchorFrm().IsInDocBody() &&
- !GetAnchorFrm().IsInTab()
- ? rFrmFmt.getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE)
- : false;
+ bool bBrowse = GetAnchorFrm().IsInDocBody() && !GetAnchorFrm().IsInTab();
+ if( bBrowse )
+ {
+ const ViewShell *pSh = GetAnchorFrm().getRootFrm()->GetCurrShell();
+ if( !pSh || !pSh->GetViewOptions()->getBrowseMode() )
+ bBrowse = false;
+ }
// determine left/right and its upper/lower spacing.
const SvxLRSpaceItem &rLR = rFrmFmt.GetLRSpace();