[Libreoffice-commits] core.git: Branch 'private/mst/sw_redlinehide' - 1110 commits - accessibility/source android/source avmedia/inc avmedia/source basctl/source basctl/uiconfig basegfx/source basegfx/test basic/source bin/check-elf-dynamic-objects bin/find-unneeded-includes bin/oss-fuzz-build.sh bridges/source canvas/source chart2/CppunitTest_chart2_dump.mk chart2/IwyuFilter_chart2.yaml chart2/qa chart2/source chart2/uiconfig comphelper/Library_comphelper.mk comphelper/qa comphelper/source compilerplugins/clang config_host/config_extensions.h.in config_host/config_extension_update.h.in config_host/config_features.h.in config_host.mk.in configmgr/source configure.ac connectivity/Library_dbtools.mk connectivity/source cppcanvas/source cppuhelper/source cppu/qa cppu/source cui/source cui/uiconfig dbaccess/source dbaccess/uiconfig desktop/Library_crashreport.mk desktop/Library_sofficeapp.mk desktop/qa desktop/source dictionaries distro-configs/LibreOfficeAndroidAarch64.conf distro-configs/LibreOffic eAndroid.conf distro-configs/LibreOfficeAndroidX86.conf distro-configs/LibreOfficeFlatpak.conf distro-configs/LibreOfficeiOS.conf distro-configs/LibreOfficeLinux.conf download.lst drawinglayer/source dtrans/source editeng/source embeddedobj/source emfio/source eventattacher/source extensions/CustomTarget_automationtest.mk extensions/Library_oleautobridge.mk extensions/Module_extensions.mk extensions/qa extensions/source extensions/test external/boost external/curl external/firebird external/libepubgen external/libnumbertext external/mariadb-connector-c external/pdfium extras/CustomTarget_opensymbol.mk extras/Module_extras.mk extras/Package_fonts.mk extras/source filter/Executable_svg2odf.mk filter/inc filter/Library_svgfilter.mk filter/Module_filter.mk filter/source filter/uiconfig forms/source formula/source fpicker/source fpicker/uiconfig framework/inc framework/source helpcontent2 hwpfilter/source i18nlangtag/qa i18nlangtag/README i18nlangtag/source i18npool/inc i18npool/Library_ i18npool.mk i18npool/Library_localedata_others.mk i18npool/qa i18npool/source icon-themes/breeze icon-themes/breeze_dark icon-themes/breeze_svg icon-themes/colibre icon-themes/colibre_svg icon-themes/elementary icon-themes/elementary_svg icon-themes/industrial icon-themes/karasa_jaga icon-themes/oxygen icon-themes/README include/avmedia include/basegfx include/comphelper include/drawinglayer include/editeng include/filter include/formula include/i18nlangtag include/IwyuFilter_include.yaml include/o3tl include/oox include/osl include/rtl include/sal include/sfx2 include/svl include/svtools include/svx include/test include/unotools include/vbahelper include/vcl include/xmloff instsetoo_native/util ios/LibreOfficeLight jvmaccess/Library_jvmaccess.mk jvmaccess/source l10ntools/source libreofficekit/Module_libreofficekit.mk libreofficekit/qa libreofficekit/UIConfig_libreofficekit.mk lingucomponent/source linguistic/source lotuswordpro/source Makefile.fetch o3tl/CompilerTest_o3tl_temporar y.mk o3tl/Module_o3tl.mk o3tl/qa odk/examples offapi/com offapi/type_reference officecfg/registry oovbaapi/ooo oovbaapi/UnoApi_oovbaapi.mk oox/source osx/soffice.xcodeproj package/source pyuno/source qadevOOo/tests readlicense_oo/docs registry/source reportdesign/source reportdesign/uiconfig RepositoryExternal.mk Repository.mk sal/osl sal/qa sal/rtl sax/qa sax/source scaddins/source sccomp/source sc/CppunitTest_sc_addin_functions_test.mk sc/CppunitTest_sc_anchor_test.mk sc/CppunitTest_sc_array_functions_test.mk sc/CppunitTest_sc_bugfix_test.mk sc/CppunitTest_sc_chart2dataprovider.mk sc/CppunitTest_sc_cond_format_merge.mk sc/CppunitTest_sc_copypaste.mk sc/CppunitTest_sc_database_functions_test.mk sc/CppunitTest_sc_dataprovider.mk sc/CppunitTest_sc_datatransformation.mk sc/CppunitTest_sc_datetime_functions_test.mk sc/CppunitTest_sc_filters_test.mk sc/CppunitTest_sc_financial_functions_test.mk sc/CppunitTest_sc_functions_test_old.mk sc/CppunitTest_sc_html_export_test.mk sc/CppunitTest_ sc_information_functions_test.mk sc/CppunitTest_sc_logical_functions_test.mk sc/CppunitTest_sc_mathematical_functions_test.mk sc/CppunitTest_sc_opencl_test.mk sc/CppunitTest_sc_parallelism.mk sc/CppunitTest_sc_pivottable_filters_test.mk sc/CppunitTest_sc_spreadsheet_functions_test.mk sc/CppunitTest_sc_statistical_functions_test.mk sc/CppunitTest_sc_subsequent_export_test.mk sc/CppunitTest_sc_subsequent_filters_test.mk sc/CppunitTest_sc_text_functions_test.mk sc/CppunitTest_sc_tiledrendering.mk sc/CppunitTest_sc_ucalc.mk sc/inc sc/IwyuFilter_sc.yaml sc/Library_scd.mk sc/Library_scfilt.mk sc/Library_sc.mk sc/Library_scqahelper.mk sc/Library_scui.mk sc/Module_sc.mk scp2/InstallModule_ooo.mk scp2/source sc/qa scripting/source sc/source sc/uiconfig sc/UITest_calc_tests2.mk sc/UITest_calc_tests3.mk sc/UITest_calc_tests4.mk sd/CppunitTest_sd_activex_controls_tests.mk sd/CppunitTest_sd_import_tests_smartart.mk sdext/source sd/inc sd/IwyuFilter_sd.yaml sd/qa sd/sdi sd/source sd/uiconfig sd/U IConfig_sdraw.mk sfx2/Library_qstart_gtk.mk sfx2/Library_sfx.mk sfx2/Module_sfx2.mk sfx2/qa sfx2/source sfx2/uiconfig shell/source slideshow/opengl slideshow/source solenv/bin solenv/clang-format solenv/CompilerTest_compilerplugins_clang.mk solenv/flatpak-manifest.in solenv/gbuild solenv/inc solenv/sanitizers soltools/mkdepend sot/source starmath/inc starmath/source starmath/uiconfig stoc/source svgio/qa svgio/source svl/CppunitTest_svl_qa_cppunit.mk svl/qa svl/source svtools/CppunitTest_svtools_graphic.mk svtools/inc svtools/qa svtools/source svx/CppunitTest_svx_unit.mk svx/inc svx/qa svx/source svx/uiconfig sw/CppunitTest_sw_docbookexport.mk sw/CppunitTest_sw_filters_test.mk sw/CppunitTest_sw_fodfexport.mk sw/CppunitTest_sw_globalfilter.mk sw/CppunitTest_sw_htmlexport.mk sw/CppunitTest_sw_htmlimport.mk sw/CppunitTest_sw_layoutwriter.mk sw/CppunitTest_sw_mailmerge.mk sw/CppunitTest_sw_odfexport.mk sw/CppunitTest_sw_odfimport.mk sw/CppunitTest_sw_ooxmlencryption.mk sw/CppunitTest_sw _ooxmlexport8.mk sw/CppunitTest_sw_ooxmlfieldexport.mk sw/CppunitTest_sw_ooxmlimport2.mk sw/CppunitTest_sw_ooxmlimport.mk sw/CppunitTest_sw_ooxmllinks.mk sw/CppunitTest_sw_ooxmlw14export.mk sw/CppunitTest_sw_rtfexport2.mk sw/CppunitTest_sw_rtfexport3.mk sw/CppunitTest_sw_rtfexport.mk sw/CppunitTest_sw_rtfimport.mk sw/CppunitTest_sw_tiledrendering.mk sw/CppunitTest_sw_txtexport.mk sw/CppunitTest_sw_uiwriter.mk sw/CppunitTest_sw_uwriter.mk sw/CppunitTest_sw_ww8export2.mk sw/CppunitTest_sw_ww8export.mk sw/CppunitTest_sw_ww8import.mk sw/inc sw/Library_msword.mk sw/Library_sw.mk sw/Library_swui.mk sw/ooxmlexport_setup.mk sw/qa sw/source sw/uiconfig sw/UIConfig_swriter.mk sysui/CustomTarget_share.mk sysui/desktop test/source tools/CppunitTest_tools_test.mk tools/qa tools/source translations ucb/source unotools/source unoxml/source uui/CppunitTest_uui_dialogs_test.mk uui/inc uui/Library_uui.mk uui/source uui/uiconfig vbahelper/source vcl/CppunitTest_vcl_apitests.mk vcl/CustomTarget_kde5_mo c.mk vcl/CustomTarget_qt5_moc.mk vcl/headless vcl/inc vcl/Library_vcl.mk vcl/Library_vclplug_gtk3_kde5.mk vcl/Library_vclplug_gtk3.mk vcl/Library_vclplug_gtk.mk vcl/Library_vclplug_kde5.mk vcl/Library_vclplug_qt5.mk vcl/Module_vcl.mk vcl/opengl vcl/osx vcl/qa vcl/qt5 vcl/quartz vcl/source vcl/UIConfig_vcl.mk vcl/unx vcl/win vcl/workben wizards/source writerfilter/source writerperfect/CppunitTest_writerperfect_wpftimport.mk writerperfect/inc writerperfect/qa writerperfect/source writerperfect/uiconfig xmlhelp/source xmloff/inc xmloff/source xmlscript/source xmlsecurity/inc xmlsecurity/Library_xsec_xmlsec.mk xmlsecurity/qa xmlsecurity/source xmlsecurity/uiconfig
Michael Stahl
Michael.Stahl at cib.de
Mon Jun 4 09:39:38 UTC 2018
Rebased ref, commits from common ancestor:
commit 09e057d71d8909060398b534ed73ff829fb08f4b
Author: Michael Stahl <Michael.Stahl at cib.de>
Date: Fri Jun 1 22:45:55 2018 +0200
sw_redlinehide: SwTextNode::Insert(): send SwInsText hint before
... adjusting hints, as the latter sends RES_UPDATE_ATTR hints
and the ModelToViewPos() asserts because the mergedText is too short.
Change-Id: I48bf6388ce69f3294decf96dc6dd11ba3bf4bc7b
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index b044a7439429..a241caf00d4e 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -1993,6 +1993,12 @@ OUString SwTextNode::InsertText( const OUString & rStr, const SwIndex & rIdx,
SetIgnoreDontExpand( bOldExpFlg );
}
+ if ( HasWriterListeners() )
+ { // send this before messing with hints, which will send RES_UPDATE_ATTR
+ SwInsText aHint( aPos, nLen );
+ NotifyClients( nullptr, &aHint );
+ }
+
if ( HasHints() )
{
bool const bHadHints(!m_pSwpHints->CanBeDeleted());
@@ -2064,12 +2070,6 @@ OUString SwTextNode::InsertText( const OUString & rStr, const SwIndex & rIdx,
"SwTextNode::InsertText: unexpected loss of hints");
}
- if ( HasWriterListeners() )
- {
- SwInsText aHint( aPos, nLen );
- NotifyClients( nullptr, &aHint );
- }
-
// By inserting a character, the hidden flags
// at the TextNode can become invalid:
SetCalcHiddenCharFlags();
commit e42d67f7aa3f33c892c8c417d1e10ae19c58e0f9
Author: Michael Stahl <Michael.Stahl at cib.de>
Date: Fri Jun 1 22:41:06 2018 +0200
sw_redlinehide: convert GetAttrSet() in txtfrm.cxx, frmtool.cxx
Change-Id: I3541fa79ff48f6829fc459ab5bd8224c29c51cbb
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index cfafce5b3d51..3713439f3f53 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -738,8 +738,7 @@ SwContentNotify::SwContentNotify( SwContentFrame *pContentFrame ) :
SwTextFrame* pTextFrame = static_cast<SwTextFrame*>(pContentFrame);
if (!pTextFrame->GetDoc().getIDocumentSettingAccess().get(DocumentSettingId::OLD_LINE_SPACING))
{
- const SwAttrSet* pSet = pTextFrame->GetAttrSet();
- const SvxLineSpacingItem &rSpace = pSet->GetLineSpacing();
+ const SvxLineSpacingItem &rSpace = pTextFrame->GetAttrSet()->GetLineSpacing();
if ( rSpace.GetInterLineSpaceRule() == SvxInterLineSpaceRule::Prop )
{
mbChkHeightOfLastLine = true;
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index 87ff04e46886..e58f3d1ecca1 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -2997,7 +2997,8 @@ void SwTextFrame::CalcHeightOfLastLine( const bool _bUseFont )
{
// former determination of last line height for proprotional line
// spacing - take height of font set at the paragraph
- SwFont aFont( GetAttrSet(), pIDSA );
+ // FIXME actually ... must the font match across all nodes?
+ SwFont aFont( &GetTextNodeForParaProps()->GetSwAttrSet(), pIDSA );
// we must ensure that the font is restored correctly on the OutputDevice
// otherwise Last!=Owner could occur
@@ -3103,8 +3104,7 @@ long SwTextFrame::GetLineSpace( const bool _bNoPropLineSpace ) const
{
long nRet = 0;
- const SwAttrSet* pSet = GetAttrSet();
- const SvxLineSpacingItem &rSpace = pSet->GetLineSpacing();
+ const SvxLineSpacingItem &rSpace = GetTextNodeForParaProps()->GetSwAttrSet().GetLineSpacing();
switch( rSpace.GetInterLineSpaceRule() )
{
@@ -3205,7 +3205,7 @@ void SwTextFrame::ChgThisLines()
if ( nNew != mnThisLines )
{
- if ( !IsInTab() && GetAttrSet()->GetLineNumber().IsCount() )
+ if (!IsInTab() && GetTextNodeForParaProps()->GetSwAttrSet().GetLineNumber().IsCount())
{
mnAllLines -= mnThisLines;
mnThisLines = nNew;
@@ -3236,12 +3236,10 @@ void SwTextFrame::RecalcAllLines()
{
ValidateLineNum();
- const SwAttrSet *pAttrSet = GetAttrSet();
-
if ( !IsInTab() )
{
const sal_uLong nOld = GetAllLines();
- const SwFormatLineNumber &rLineNum = pAttrSet->GetLineNumber();
+ const SwFormatLineNumber &rLineNum = GetTextNodeForParaProps()->GetSwAttrSet().GetLineNumber();
sal_uLong nNewNum;
const bool bRestart = GetDoc().GetLineNumberInfo().IsRestartEachPage();
commit c3a48c6c5a74dc06e61660c509dcc844574d2ec3
Author: Michael Stahl <Michael.Stahl at cib.de>
Date: Fri Jun 1 22:37:02 2018 +0200
sw_redlinehide: move SwContentNode::GetNode() to SwNoTextNode
SwTextNode's GetDep() may be a WriterMultiListener, which isn't even a
node.
SwTextNode has GetTextNodeForParaProps()/GetTextNodeFirst().
Change-Id: Ica177a6a3cf7c886c9a8d2733fb9cb452a475450
diff --git a/sw/source/core/inc/cntfrm.hxx b/sw/source/core/inc/cntfrm.hxx
index 62413e38de8c..aa28f580f3ad 100644
--- a/sw/source/core/inc/cntfrm.hxx
+++ b/sw/source/core/inc/cntfrm.hxx
@@ -71,9 +71,6 @@ public:
virtual void Cut() override;
virtual void Paste( SwFrame* pParent, SwFrame* pSibling = nullptr ) override;
- inline const SwContentNode *GetNode() const;
- inline SwContentNode *GetNode();
-
inline const SwContentFrame *GetFollow() const;
inline SwContentFrame *GetFollow();
SwTextFrame* FindMaster() const;
@@ -114,15 +111,6 @@ inline SwContentFrame* SwContentFrame::GetPrevContentFrame() const
return const_cast<SwContentFrame*>(ImplGetNextContentFrame( false ));
}
-inline SwContentNode *SwContentFrame::GetNode()
-{
- return static_cast< SwContentNode* >( GetDep() );
-}
-inline const SwContentNode *SwContentFrame::GetNode() const
-{
- return static_cast< const SwContentNode* >( GetDep() );
-}
-
inline const SwContentFrame *SwContentFrame::GetFollow() const
{
return static_cast<const SwContentFrame*>(SwFlowFrame::GetFollow());
diff --git a/sw/source/core/inc/notxtfrm.hxx b/sw/source/core/inc/notxtfrm.hxx
index 9de5fd31abfe..eaa10653964b 100644
--- a/sw/source/core/inc/notxtfrm.hxx
+++ b/sw/source/core/inc/notxtfrm.hxx
@@ -54,6 +54,11 @@ protected:
public:
SwNoTextFrame( SwNoTextNode * const, SwFrame* );
+ const SwContentNode *GetNode() const
+ { return static_cast<SwContentNode const*>(GetDep()); }
+ SwContentNode *GetNode()
+ { return static_cast<SwContentNode *>(GetDep()); }
+
virtual bool LeftMargin(SwPaM *) const override;
virtual bool RightMargin(SwPaM *, bool bAPI = false) const override;
diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx
index 9ace62c83b20..cf602a0ee0c4 100644
--- a/sw/source/core/inc/txtfrm.hxx
+++ b/sw/source/core/inc/txtfrm.hxx
@@ -398,9 +398,9 @@ public:
const OUString& GetText() const;
#if 1
SwTextNode *GetTextNode()
- { return static_cast< SwTextNode* >( SwContentFrame::GetNode()); }
+ { return static_cast<SwTextNode*>(SwFrame::GetDep()); }
const SwTextNode *GetTextNode() const
- { return static_cast< const SwTextNode* >( SwContentFrame::GetNode()); }
+ { return static_cast<const SwTextNode*>(SwFrame::GetDep()); }
public:
#endif
SwTextNode const* GetTextNodeForParaProps() const;
commit e5825fdbc64861949a0a066e3caab02218541a0f
Author: Michael Stahl <Michael.Stahl at cib.de>
Date: Fri Jun 1 22:32:26 2018 +0200
sw_redlinehide: convert GetNode(), use FrameContainsNode(), txtfly.cxx
Change-Id: I0e4961acc191a764db74ede75e140e63ad1318a0
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index 716206df0ac3..781b92980ea5 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -692,7 +692,7 @@ static const SwContentFrame * lcl_MissProtectedFrames( const SwContentFrame *pCn
static bool lcl_UpDown( SwPaM *pPam, const SwContentFrame *pStart,
GetNxtPrvCnt fnNxtPrv, bool bInReadOnly )
{
- OSL_ENSURE( &pPam->GetNode() == pStart->GetNode(),
+ OSL_ENSURE( FrameContainsNode(*pStart, pPam->GetNode().GetIndex()),
"lcl_UpDown doesn't work for others." );
const SwContentFrame *pCnt = nullptr;
diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx
index c7d3f891fa0d..45950b93ec6b 100644
--- a/sw/source/core/text/txtfly.cxx
+++ b/sw/source/core/text/txtfly.cxx
@@ -834,9 +834,9 @@ bool SwTextFly::GetTop( const SwAnchoredObject* _pAnchoredObj,
// If possible determine Index via SwFormatAnchor because
// otherwise it's quite expensive.
if (ULONG_MAX == m_nCurrFrameNodeIndex)
- m_nCurrFrameNodeIndex = m_pCurrFrame->GetNode()->GetIndex();
+ m_nCurrFrameNodeIndex = m_pCurrFrame->GetTextNodeFirst()->GetIndex();
- if (nTmpIndex < m_nCurrFrameNodeIndex)
+ if (FrameContainsNode(*m_pCurrFrame, nTmpIndex) || nTmpIndex < m_nCurrFrameNodeIndex)
return true;
}
}
commit 436e080923a604a005c0f9a8490e3e17b1b0b29d
Author: Michael Stahl <Michael.Stahl at cib.de>
Date: Fri Jun 1 22:30:58 2018 +0200
sw_redlinehide: iterate merged nodes in SwLayIdle::DoIdleJob_()
Change-Id: I42924448749385bb0e5bc2c187e37053e104c0da
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index a4df2477ea01..e98f19ccb771 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -1847,19 +1847,50 @@ bool SwLayIdle::DoIdleJob_( const SwContentFrame *pCnt, IdleJobType eJob )
if( !pCnt->IsTextFrame() )
return false;
- const SwTextNode* pTextNode = pCnt->GetNode()->GetTextNode();
+ SwTextFrame const*const pTextFrame(static_cast<SwTextFrame const*>(pCnt));
+ // sw_redlinehide: spell check only the nodes with visible content?
+ const SwTextNode* pTextNode = pTextFrame->GetTextNodeForParaProps();
bool bProcess = false;
- switch ( eJob )
+ for (size_t i = 0; pTextNode; )
{
- case ONLINE_SPELLING :
- bProcess = pTextNode->IsWrongDirty(); break;
- case AUTOCOMPLETE_WORDS :
- bProcess = pTextNode->IsAutoCompleteWordDirty(); break;
- case WORD_COUNT :
- bProcess = pTextNode->IsWordCountDirty(); break;
- case SMART_TAGS :
- bProcess = pTextNode->IsSmartTagDirty(); break;
+ switch ( eJob )
+ {
+ case ONLINE_SPELLING :
+ bProcess = pTextNode->IsWrongDirty(); break;
+ case AUTOCOMPLETE_WORDS :
+ bProcess = pTextNode->IsAutoCompleteWordDirty(); break;
+ case WORD_COUNT :
+ bProcess = pTextNode->IsWordCountDirty(); break;
+ case SMART_TAGS :
+ bProcess = pTextNode->IsSmartTagDirty(); break;
+ }
+ if (bProcess)
+ {
+ break;
+ }
+ if (sw::MergedPara const* pMerged = pTextFrame->GetMergedPara())
+ {
+ while (true)
+ {
+ ++i;
+ if (i < pMerged->extents.size())
+ {
+ if (pMerged->extents[i].pNode != pTextNode)
+ {
+ pTextNode = pMerged->extents[i].pNode;
+ break;
+ }
+ }
+ else
+ {
+ pTextNode = nullptr;
+ break;
+ }
+ }
+ }
+ else
+ pTextNode = nullptr;
}
if( bProcess )
commit ae4122254e219512ffc9db1619f37d19bdcea700
Author: Michael Stahl <Michael.Stahl at cib.de>
Date: Fri Jun 1 22:29:16 2018 +0200
sw_redlinehide: convert GetNode() in frmtool.cxx
Change-Id: I6787ec787190ad297717ab01a78414cac34aa2cb
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index 12a5b322cc07..cfafce5b3d51 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -823,8 +823,8 @@ SwContentNotify::~SwContentNotify()
SwViewShell *pSh = pCnt->getRootFrame()->GetCurrShell();
if ( pSh )
{
- SwOLENode *pNd;
- if ( nullptr != (pNd = pCnt->GetNode()->GetOLENode()) &&
+ SwOLENode *const pNd(static_cast<SwNoTextFrame*>(pCnt)->GetNode()->GetOLENode());
+ if (nullptr != pNd &&
(pNd->GetOLEObj().IsOleRef() ||
pNd->IsOLESizeInvalid()) )
{
@@ -882,7 +882,9 @@ SwContentNotify::~SwContentNotify()
{
pCnt->SetRetouche(); //fix(13870)
- SwDoc *pDoc = pCnt->GetNode()->GetDoc();
+ SwDoc *const pDoc = pCnt->IsTextFrame()
+ ? &static_cast<SwTextFrame*>(pCnt)->GetDoc()
+ : static_cast<SwNoTextFrame*>(pCnt)->GetNode()->GetDoc();
if ( !pDoc->GetSpzFrameFormats()->empty() &&
pDoc->DoesContainAtPageObjWithContentAnchor() && !pDoc->getIDocumentState().IsNewDoc() )
{
@@ -895,7 +897,6 @@ SwContentNotify::~SwContentNotify()
// the page is known. Thus, this data can be corrected now.
const SwPageFrame *pPage = nullptr;
- SwNodeIndex *pIdx = nullptr;
SwFrameFormats *pTable = pDoc->GetSpzFrameFormats();
for ( size_t i = 0; i < pTable->size(); ++i )
@@ -908,11 +909,7 @@ SwContentNotify::~SwContentNotify()
continue;
}
- if ( !pIdx )
- {
- pIdx = new SwNodeIndex( *pCnt->GetNode() );
- }
- if ( rAnch.GetContentAnchor()->nNode == *pIdx )
+ if (FrameContainsNode(*pCnt, rAnch.GetContentAnchor()->nNode.GetIndex()))
{
OSL_FAIL( "<SwContentNotify::~SwContentNotify()> - to page anchored object with content position." );
if ( !pPage )
@@ -929,7 +926,6 @@ SwContentNotify::~SwContentNotify()
}
}
}
- delete pIdx;
}
}
@@ -1829,7 +1825,9 @@ void MakeFrames( SwDoc *pDoc, const SwNodeIndex &rSttIdx,
SwBorderAttrs::SwBorderAttrs(const SwModify *pMod, const SwFrame *pConstructor)
: SwCacheObj(pMod)
, m_rAttrSet(pConstructor->IsContentFrame()
- ? static_cast<const SwContentFrame*>(pConstructor)->GetNode()->GetSwAttrSet()
+ ? pConstructor->IsTextFrame()
+ ? static_cast<const SwTextFrame*>(pConstructor)->GetTextNodeForParaProps()->GetSwAttrSet()
+ : static_cast<const SwNoTextFrame*>(pConstructor)->GetNode()->GetSwAttrSet()
: static_cast<const SwLayoutFrame*>(pConstructor)->GetFormat()->GetAttrSet())
, m_rUL(m_rAttrSet.GetULSpace())
// #i96772#
@@ -2206,14 +2204,20 @@ void SwBorderAttrs::GetBottomLine_( const SwFrame& _rFrame )
m_nGetBottomLine = nRet;
}
+static SwModify const* GetCacheOwner(SwFrame const& rFrame)
+{
+ return rFrame.IsContentFrame()
+ ? static_cast<SwModify const*>(rFrame.IsTextFrame()
+ // sw_redlinehide: presumably this caches the border attrs at the model level and can be shared across different layouts so we want the ParaProps node here
+ ? static_cast<const SwTextFrame&>(rFrame).GetTextNodeForParaProps()
+ : static_cast<const SwNoTextFrame&>(rFrame).GetNode())
+ : static_cast<SwModify const*>(static_cast<const SwLayoutFrame&>(rFrame).GetFormat());
+}
+
SwBorderAttrAccess::SwBorderAttrAccess( SwCache &rCach, const SwFrame *pFrame ) :
SwCacheAccess( rCach,
- (pFrame->IsContentFrame() ?
- const_cast<void*>(static_cast<void const *>(static_cast<const SwContentFrame*>(pFrame)->GetNode())) :
- const_cast<void*>(static_cast<void const *>(static_cast<const SwLayoutFrame*>(pFrame)->GetFormat()))),
- (pFrame->IsContentFrame() ?
- static_cast<SwModify const *>(static_cast<const SwContentFrame*>(pFrame)->GetNode())->IsInCache() :
- static_cast<SwModify const *>(static_cast<const SwLayoutFrame*>(pFrame)->GetFormat())->IsInCache()) ),
+ static_cast<void const *>(GetCacheOwner(*pFrame)),
+ GetCacheOwner(*pFrame)->IsInCache()),
m_pConstructor( pFrame )
{
}
commit 5935b71f3c844cfb1ac0fa12ed6cb1d48aab5275
Author: Michael Stahl <Michael.Stahl at cib.de>
Date: Fri Jun 1 22:26:52 2018 +0200
sw_redlinehide: convert GetNode(), use FrameContainsNode() in flycnt.cxx
Change-Id: I551d37c961149bb043bed4cde7b52822f5e3db81
diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx
index 71cdcc029235..7e1f1079a686 100644
--- a/sw/source/core/layout/flycnt.cxx
+++ b/sw/source/core/layout/flycnt.cxx
@@ -20,6 +20,7 @@
#include <tools/bigint.hxx>
#include <pagefrm.hxx>
#include <txtfrm.hxx>
+#include <notxtfrm.hxx>
#include <doc.hxx>
#include <pam.hxx>
#include <IDocumentUndoRedo.hxx>
@@ -114,7 +115,11 @@ void SwFlyAtContentFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pN
// Search the new anchor using the NodeIdx; the relation between old
// and new NodeIdx determines the search direction
const SwNodeIndex aNewIdx( pAnch->GetContentAnchor()->nNode );
- SwNodeIndex aOldIdx( *pContent->GetNode() );
+ SwNodeIndex aOldIdx( pContent->IsTextFrame()
+ // sw_redlinehide: can pick any node here, the compare with
+ // FrameContainsNode should catch it
+ ? *static_cast<SwTextFrame *>(pContent)->GetTextNodeFirst()
+ : *static_cast<SwNoTextFrame *>(pContent)->GetNode() );
//fix: depending on which index was smaller, searching in the do-while
//loop previously was done forward or backwards respectively. This however
@@ -122,12 +127,12 @@ void SwFlyAtContentFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pN
//is now done in only one direction. Getting hold of a frame from the node
//is still possible if the new anchor could not be found. Chances are
//good that this will be the correct one.
- const bool bNext = aOldIdx < aNewIdx;
// consider the case that at found anchor frame candidate already a
// fly frame of the given fly format is registered.
// consider, that <pContent> is the already
// the new anchor frame.
- bool bFound( aOldIdx == aNewIdx );
+ bool bFound( FrameContainsNode(*pContent, aNewIdx.GetIndex()) );
+ const bool bNext = !bFound && aOldIdx < aNewIdx;
while ( pContent && !bFound )
{
do
@@ -140,11 +145,10 @@ void SwFlyAtContentFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pN
( bBodyFootnote != ( pContent->IsInDocBody() ||
pContent->IsInFootnote() ) ) );
if ( pContent )
- aOldIdx = *pContent->GetNode();
+ bFound = FrameContainsNode(*pContent, aNewIdx.GetIndex());
// check, if at found anchor frame candidate already a fly frame
// of the given fly frame format is registered.
- bFound = aOldIdx == aNewIdx;
if (bFound && pContent && pContent->GetDrawObjs())
{
SwFrameFormat* pMyFlyFrameFormat( &GetFrameFormat() );
@@ -1327,19 +1331,18 @@ void SwFlyAtContentFrame::SetAbsPos( const Point &rNew )
SwPosition pos = *aAnch.GetContentAnchor();
if( IsAutoPos() && pCnt->IsTextFrame() )
{
+ SwTextFrame const*const pTextFrame(static_cast<SwTextFrame const*>(pCnt));
SwCursorMoveState eTmpState( MV_SETONLYTEXT );
Point aPt( rNew );
if( pCnt->GetCursorOfst( &pos, aPt, &eTmpState )
- && pos.nNode == *pCnt->GetNode() )
+ && FrameContainsNode(*pTextFrame, pos.nNode.GetIndex()))
{
- if ( pCnt->GetNode()->GetTextNode() != nullptr )
+ const SwTextAttr *const pTextInputField =
+ pos.nNode.GetNode().GetTextNode()->GetTextAttrAt(
+ pos.nContent.GetIndex(), RES_TXTATR_INPUTFIELD, SwTextNode::PARENT );
+ if (pTextInputField != nullptr)
{
- const SwTextAttr* pTextInputField =
- pCnt->GetNode()->GetTextNode()->GetTextAttrAt( pos.nContent.GetIndex(), RES_TXTATR_INPUTFIELD, SwTextNode::PARENT );
- if ( pTextInputField != nullptr )
- {
- pos.nContent = pTextInputField->GetStart();
- }
+ pos.nContent = pTextInputField->GetStart();
}
ResetLastCharRectHeight();
if( text::RelOrientation::CHAR == pFormat->GetVertOrient().GetRelationOrient() )
@@ -1349,14 +1352,18 @@ void SwFlyAtContentFrame::SetAbsPos( const Point &rNew )
}
else
{
- pos.nNode = *pCnt->GetNode();
- pos.nContent.Assign( pCnt->GetNode(), 0 );
+ pos = pTextFrame->MapViewToModelPos(TextFrameIndex(0));
}
}
- else
+ else if (pCnt->IsTextFrame())
+ {
+ pos = static_cast<SwTextFrame const*>(pCnt)->MapViewToModelPos(TextFrameIndex(0));
+ }
+ else // is that even possible? maybe if there was a change of anchor type from AT_FLY or something?
{
- pos.nNode = *pCnt->GetNode();
- pos.nContent.Assign( pCnt->GetNode(), 0 );
+ assert(pCnt->IsNoTextFrame());
+ pos.nNode = *static_cast<SwNoTextFrame*>(pCnt)->GetNode();
+ pos.nContent.Assign(static_cast<SwNoTextFrame*>(pCnt)->GetNode(), 0);
}
aAnch.SetAnchor( &pos );
commit 3c8204dc803aaad611555184e001111c0b5becc9
Author: Michael Stahl <Michael.Stahl at cib.de>
Date: Fri Jun 1 22:24:24 2018 +0200
sw_redlinehide: convert GetNode() in SwFlowFrame::BwdMoveNecessary()
Change-Id: Iaefed6ebee4f4cf47697c174abc275b1287f643f
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx
index 1dce5a5131ff..46af46fbe942 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -343,21 +343,28 @@ sal_uInt8 SwFlowFrame::BwdMoveNecessary( const SwPageFrame *pPage, const SwRect
if( ULONG_MAX == nIndex )
{
const SwNode *pNode;
- if ( m_rThis.IsContentFrame() )
- pNode = static_cast<SwContentFrame&>(m_rThis).GetNode();
+ if (m_rThis.IsTextFrame())
+ pNode = static_cast<SwTextFrame&>(m_rThis).GetTextNodeFirst();
+ else if (m_rThis.IsNoTextFrame())
+ pNode = static_cast<SwNoTextFrame&>(m_rThis).GetNode();
else if( m_rThis.IsSctFrame() )
pNode = static_cast<SwSectionFormat*>(static_cast<SwSectionFrame&>(m_rThis).
GetFormat())->GetSectionNode();
else
{
+ assert(!m_rThis.IsContentFrame());
OSL_ENSURE( m_rThis.IsTabFrame(), "new FowFrame?" );
pNode = static_cast<SwTabFrame&>(m_rThis).GetTable()->
GetTabSortBoxes()[0]->GetSttNd()->FindTableNode();
}
nIndex = pNode->GetIndex();
}
- if( nIndex < nTmpIndex )
+ if (nIndex < nTmpIndex &&
+ (!m_rThis.IsTextFrame() ||
+ !FrameContainsNode(static_cast<SwTextFrame&>(m_rThis), nTmpIndex)))
+ {
continue;
+ }
}
}
else
commit 524014a22d78a3c55e0d6d73c1a43066824087d2
Author: Michael Stahl <Michael.Stahl at cib.de>
Date: Fri Jun 1 22:22:48 2018 +0200
sw_redlinehide: convert GetNode() in SwCursor::IsSelOvr()
Change-Id: I3cca2091f4a3fe903bbd606c93a368662e997899
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index 91e9e2e61551..2b934cb6c576 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -39,6 +39,7 @@
#include <cntfrm.hxx>
#include <rootfrm.hxx>
#include <txtfrm.hxx>
+#include <notxtfrm.hxx>
#include <scriptinfo.hxx>
#include <crstate.hxx>
#include <docsh.hxx>
@@ -351,18 +352,31 @@ bool SwCursor::IsSelOvr( SwCursorSelOverFlags eFlags )
}
}
- SwContentNode* pCNd = (pFrame != nullptr) ? const_cast<SwContentNode*>(pFrame->GetNode()) : nullptr;
- if ( pCNd != nullptr )
+ if (pFrame != nullptr)
{
- // set this ContentNode as new position
- rPtIdx = *pCNd;
+ if (pFrame->IsTextFrame())
+ {
+ SwTextFrame const*const pTextFrame(static_cast<SwTextFrame const*>(pFrame));
+ *GetPoint() = pTextFrame->MapViewToModelPos(TextFrameIndex(
+ bGoNxt ? 0 : pTextFrame->GetText().getLength()));
+ }
+ else
+ {
+ assert(pFrame->IsNoTextFrame());
+ SwContentNode *const pCNd = const_cast<SwContentNode*>(
+ static_cast<SwNoTextFrame const*>(pFrame)->GetNode());
+ assert(pCNd);
+
+ // set this ContentNode as new position
+ rPtIdx = *pCNd;
+ // assign corresponding ContentIndex
+ const sal_Int32 nTmpPos = bGoNxt ? 0 : pCNd->Len();
+ GetPoint()->nContent.Assign( pCNd, nTmpPos );
+ }
- // assign corresponding ContentIndex
- const sal_Int32 nTmpPos = bGoNxt ? 0 : pCNd->Len();
- GetPoint()->nContent.Assign( pCNd, nTmpPos );
if (rPtIdx.GetIndex() == m_vSavePos.back().nNode
- && nTmpPos == m_vSavePos.back().nContent)
+ && GetPoint()->nContent.GetIndex() == m_vSavePos.back().nContent)
{
// new position equals saved one
// --> trigger restore of saved pos by setting <pFrame> to NULL - see below
commit 624393c3441dba9cc5520cb76c828bfa1b69e7fd
Author: Michael Stahl <Michael.Stahl at cib.de>
Date: Fri Jun 1 22:16:28 2018 +0200
sw_redlinehide: refactor AppendObjs to iterate merged paragraphs
Change-Id: I5860b9791c0839d4b83eec6a3db0b2d1926d2ccd
diff --git a/sw/source/core/inc/flyfrm.hxx b/sw/source/core/inc/flyfrm.hxx
index 0c4c9319b3ed..c28dcd98b882 100644
--- a/sw/source/core/inc/flyfrm.hxx
+++ b/sw/source/core/inc/flyfrm.hxx
@@ -25,6 +25,7 @@
#include <frmfmt.hxx>
#include <anchoredobject.hxx>
+class SwFormatAnchor;
class SwPageFrame;
class SwFormatFrameSize;
struct SwCursorMoveState;
@@ -58,7 +59,7 @@ bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, bool bMove = true );
class SwFlyFrame : public SwLayoutFrame, public SwAnchoredObject
{
// is allowed to lock, implemented in frmtool.cxx
- friend void AppendObjs ( const SwFrameFormats *, sal_uLong, SwFrame *, SwPageFrame *, SwDoc* );
+ friend void AppendObj(SwFrame *const pFrame, SwPageFrame *const pPage, SwFrameFormat *const pFormat, const SwFormatAnchor & rAnch);
friend void Notify( SwFlyFrame *, SwPageFrame *pOld, const SwRect &rOld,
const SwRect* pOldPrt );
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index bfdb15bc1a86..12a5b322cc07 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -973,38 +973,9 @@ SwContentNotify::~SwContentNotify()
}
}
-void AppendObjs( const SwFrameFormats *pTable, sal_uLong nIndex,
- SwFrame *pFrame, SwPageFrame *pPage, SwDoc* doc )
+// note this *cannot* be static because it's a friend
+void AppendObj(SwFrame *const pFrame, SwPageFrame *const pPage, SwFrameFormat *const pFormat, const SwFormatAnchor & rAnch)
{
-#if OSL_DEBUG_LEVEL > 0
- std::vector<SwFrameFormat*> checkFormats;
- for ( size_t i = 0; i < pTable->size(); ++i )
- {
- SwFrameFormat *pFormat = (*pTable)[i];
- const SwFormatAnchor &rAnch = pFormat->GetAnchor();
- if ( rAnch.GetContentAnchor() &&
- (rAnch.GetContentAnchor()->nNode.GetIndex() == nIndex) )
- {
- checkFormats.push_back( pFormat );
- }
- }
-#else
- (void)pTable;
-#endif
- SwNode const& rNode(*doc->GetNodes()[nIndex]);
- std::vector<SwFrameFormat*> const*const pFlys(rNode.GetAnchoredFlys());
- for (size_t it = 0; pFlys && it != pFlys->size(); )
- {
- SwFrameFormat *const pFormat = (*pFlys)[it];
- const SwFormatAnchor &rAnch = pFormat->GetAnchor();
- if ( rAnch.GetContentAnchor() &&
- (rAnch.GetContentAnchor()->nNode.GetIndex() == nIndex) )
- {
-#if OSL_DEBUG_LEVEL > 0
- std::vector<SwFrameFormat*>::iterator checkPos = std::find( checkFormats.begin(), checkFormats.end(), pFormat );
- assert( checkPos != checkFormats.end());
- checkFormats.erase( checkPos );
-#endif
const bool bFlyAtFly = rAnch.GetAnchorId() == RndStdIds::FLY_AT_FLY; // LAYER_IMPL
//Is a frame or a SdrObject described?
const bool bSdrObj = RES_DRAWFRMFMT == pFormat->Which();
@@ -1022,9 +993,8 @@ void AppendObjs( const SwFrameFormats *pTable, sal_uLong nIndex,
if ( bSdrObj && nullptr == (pSdrObj = pFormat->FindSdrObject()) )
{
OSL_ENSURE( !bSdrObj, "DrawObject not found." );
- ++it;
pFormat->GetDoc()->DelFrameFormat( pFormat );
- continue;
+ return;
}
if ( pSdrObj )
{
@@ -1051,7 +1021,6 @@ void AppendObjs( const SwFrameFormats *pTable, sal_uLong nIndex,
pDrawVirtObj->ActionChanged();
}
-
}
else
{
@@ -1067,14 +1036,133 @@ void AppendObjs( const SwFrameFormats *pTable, sal_uLong nIndex,
::RegistFlys( pPage, pFly );
}
}
+}
+
+static bool IsShown(sal_uLong const nIndex,
+ const SwFormatAnchor & rAnch,
+ std::vector<sw::Extent>::const_iterator *const pIter,
+ std::vector<sw::Extent>::const_iterator const*const pEnd)
+{
+ SwPosition const& rAnchor(*rAnch.GetContentAnchor());
+ if (pIter && rAnch.GetAnchorId() != RndStdIds::FLY_AT_PARA)
+ {
+ // TODO are frames sorted by anchor positions perhaps?
+ assert(pEnd);
+ assert(rAnch.GetAnchorId() != RndStdIds::FLY_AT_FLY);
+ for ( ; *pIter != *pEnd; ++*pIter)
+ {
+ assert((**pIter).pNode->GetIndex() == nIndex);
+ if ((**pIter).nStart <= rAnchor.nContent.GetIndex())
+ {
+ // TODO off by one? need < for AS_CHAR but what for AT_CHAR?
+ if (rAnchor.nContent.GetIndex() < (**pIter).nEnd)
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ }
+ return false;
+ }
+ else
+ {
+ return rAnch.GetContentAnchor()->nNode.GetIndex() == nIndex;
+ }
+}
+
+void AppendObjsOfNode(SwFrameFormats const*const pTable, sal_uLong const nIndex,
+ SwFrame *const pFrame, SwPageFrame *const pPage, SwDoc *const pDoc,
+ std::vector<sw::Extent>::const_iterator *const pIter,
+ std::vector<sw::Extent>::const_iterator const*const pEnd)
+{
+#if OSL_DEBUG_LEVEL > 0
+ std::vector<SwFrameFormat*> checkFormats;
+ for ( size_t i = 0; i < pTable->size(); ++i )
+ {
+ SwFrameFormat *pFormat = (*pTable)[i];
+ const SwFormatAnchor &rAnch = pFormat->GetAnchor();
+ if ( rAnch.GetContentAnchor() &&
+ IsShown(nIndex, rAnch, pIter, pEnd))
+ {
+ checkFormats.push_back( pFormat );
+ }
+ }
+#else
+ (void)pTable;
+#endif
+
+ SwNode const& rNode(*pDoc->GetNodes()[nIndex]);
+ std::vector<SwFrameFormat*> const*const pFlys(rNode.GetAnchoredFlys());
+ for (size_t it = 0; pFlys && it != pFlys->size(); )
+ {
+ SwFrameFormat *const pFormat = (*pFlys)[it];
+ const SwFormatAnchor &rAnch = pFormat->GetAnchor();
+ if ( rAnch.GetContentAnchor() &&
+ IsShown(nIndex, rAnch, pIter, pEnd))
+ {
+#if OSL_DEBUG_LEVEL > 0
+ std::vector<SwFrameFormat*>::iterator checkPos = std::find( checkFormats.begin(), checkFormats.end(), pFormat );
+ assert( checkPos != checkFormats.end());
+ checkFormats.erase( checkPos );
+#endif
+ AppendObj(pFrame, pPage, pFormat, rAnch);
}
++it;
}
+
#if OSL_DEBUG_LEVEL > 0
assert( checkFormats.empty());
#endif
}
+
+void AppendObjs(const SwFrameFormats *const pTable, sal_uLong const nIndex,
+ SwFrame *const pFrame, SwPageFrame *const pPage, SwDoc *const pDoc)
+{
+ if (pFrame->IsTextFrame())
+ {
+ SwTextFrame const*const pTextFrame(static_cast<SwTextFrame const*>(pFrame));
+ if (sw::MergedPara const*const pMerged = pTextFrame->GetMergedPara())
+ {
+ std::vector<sw::Extent>::const_iterator iterFirst(pMerged->extents.begin());
+ std::vector<sw::Extent>::const_iterator iter(iterFirst);
+ SwTextNode const* pNode(nullptr);
+ for ( ; iter != pMerged->extents.end(); ++iter)
+ {
+ if (iter->pNode != pNode)
+ {
+ if (pNode)
+ {
+ AppendObjsOfNode(pTable, pNode->GetIndex(), pFrame, pPage, pDoc, &iterFirst, &iter);
+ }
+ else
+ {
+ assert(nIndex == iter->pNode->GetIndex()); // first iteration
+ }
+ pNode = iter->pNode;
+ iterFirst = iter;
+ }
+ }
+ if (!pNode)
+ { // no extents?
+ pNode = pMerged->pFirstNode;
+ }
+ AppendObjsOfNode(pTable, pNode->GetIndex(), pFrame, pPage, pDoc, &iterFirst, &iter);
+ }
+ else
+ {
+ return AppendObjsOfNode(pTable, nIndex, pFrame, pPage, pDoc, nullptr, nullptr);
+ }
+ }
+ else
+ {
+ return AppendObjsOfNode(pTable, nIndex, pFrame, pPage, pDoc, nullptr, nullptr);
+ }
+}
+
void AppendAllObjs(const SwFrameFormats* pTable, const SwFrame* pSib)
{
//Connecting of all Objects, which are described in the SpzTable with the
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 43723ef67518..9817b082b688 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -47,6 +47,7 @@
#include <cellfrm.hxx>
#include <flyfrms.hxx>
#include <txtfrm.hxx>
+#include <notxtfrm.hxx>
#include <htmltbl.hxx>
#include <sectfrm.hxx>
#include <fmtfollowtextflow.hxx>
@@ -1178,7 +1179,11 @@ bool SwTabFrame::Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowK
SwContentFrame* pFrame = pHeadline->ContainsContent();
while( pFrame )
{
- nIndex = pFrame->GetNode()->GetIndex();
+ // sw_redlinehide: the implementation of AppendObjs
+ // takes care of iterating merged SwTextFrame
+ nIndex = pFrame->IsTextFrame()
+ ? static_cast<SwTextFrame*>(pFrame)->GetTextNodeFirst()->GetIndex()
+ : static_cast<SwNoTextFrame*>(pFrame)->GetNode()->GetIndex();
AppendObjs( pTable, nIndex, pFrame, pPage, GetFormat()->GetDoc());
pFrame = pFrame->GetNextContentFrame();
if( !pHeadline->IsAnLower( pFrame ) )
commit 0e9d702d3503ca9ccfcd2ba73e9deac32af579a5
Author: Michael Stahl <Michael.Stahl at cib.de>
Date: Fri Jun 1 22:03:42 2018 +0200
sw_redlinehide: trivial convert to GetPageDescItem()/GetBreakItem()
Change-Id: Ia652ff428c232b9307e41da8f6b9648f486f7179
diff --git a/sw/source/core/frmedt/fedesc.cxx b/sw/source/core/frmedt/fedesc.cxx
index 588dd8e1dd6b..2177047e19aa 100644
--- a/sw/source/core/frmedt/fedesc.cxx
+++ b/sw/source/core/frmedt/fedesc.cxx
@@ -68,7 +68,7 @@ void SwFEShell::ChgCurPageDesc( const SwPageDesc& rDesc )
{
if ( pFlow->IsInTab() )
pFlow = pFlow->FindTabFrame();
- const SwFormatPageDesc& rPgDesc = pFlow->GetAttrSet()->GetPageDesc();
+ const SwFormatPageDesc& rPgDesc = pFlow->GetPageDescItem();
if( rPgDesc.GetPageDesc() )
{
// we found the culprit
diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx
index 4d5743a2a957..9035c0e85f7c 100644
--- a/sw/source/core/frmedt/fews.cxx
+++ b/sw/source/core/frmedt/fews.cxx
@@ -369,7 +369,7 @@ void SwFEShell::SetPageOffset( sal_uInt16 nOffset )
{
if ( pFlow->IsInTab() )
pFlow = pFlow->FindTabFrame();
- const SwFormatPageDesc& rPgDesc = pFlow->GetAttrSet()->GetPageDesc();
+ const SwFormatPageDesc& rPgDesc = pFlow->GetPageDescItem();
if ( rPgDesc.GetNumOffset() )
{
pDocLayout->SetVirtPageNum( true );
@@ -391,7 +391,7 @@ sal_uInt16 SwFEShell::GetPageOffset() const
{
if ( pFlow->IsInTab() )
pFlow = pFlow->FindTabFrame();
- ::boost::optional<sal_uInt16> oNumOffset = pFlow->GetAttrSet()->GetPageDesc().GetNumOffset();
+ ::boost::optional<sal_uInt16> oNumOffset = pFlow->GetPageDescItem().GetNumOffset();
if ( oNumOffset )
return oNumOffset.get();
}
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx
index d7c651a7c597..1dce5a5131ff 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -841,7 +841,7 @@ bool SwFrame::WrongPageDesc( SwPageFrame* pNew )
SwFlowFrame *pFlow = SwFlowFrame::CastFlowFrame( this );
if ( !pFlow || !pFlow->IsFollow() )
{
- const SwFormatPageDesc &rFormatDesc = GetAttrSet()->GetPageDesc();
+ const SwFormatPageDesc &rFormatDesc = GetPageDescItem();
pDesc = rFormatDesc.GetPageDesc();
if( pDesc )
{
@@ -870,7 +870,8 @@ bool SwFrame::WrongPageDesc( SwPageFrame* pNew )
if ( pNewFlow && pNewFlow->GetFrame().IsInTab() )
pNewFlow = pNewFlow->GetFrame().FindTabFrame();
const SwPageDesc *pNewDesc= ( pNewFlow && !pNewFlow->IsFollow() )
- ? pNewFlow->GetFrame().GetAttrSet()->GetPageDesc().GetPageDesc() : nullptr;
+ ? pNewFlow->GetFrame().GetPageDescItem().GetPageDesc()
+ : nullptr;
SAL_INFO( "sw.pageframe", "WrongPageDesc p: " << pNew << " phys: " << pNew->GetPhyPageNum() );
SAL_INFO( "sw.pageframe", "WrongPageDesc " << pNew->GetPageDesc() << " " << pDesc );
@@ -1130,7 +1131,6 @@ bool SwFlowFrame::IsPageBreak( bool bAct ) const
const SwViewShell *pSh = m_rThis.getRootFrame()->GetCurrShell();
if( pSh && pSh->GetViewOptions()->getBrowseMode() )
return false;
- const SwAttrSet *pSet = m_rThis.GetAttrSet();
// Determine predecessor
const SwFrame *pPrev = m_rThis.FindPrev();
@@ -1153,18 +1153,20 @@ bool SwFlowFrame::IsPageBreak( bool bAct ) const
//for compatibility, also break at column break if no columns exist
const IDocumentSettingAccess& rIDSA = m_rThis.GetUpper()->GetFormat()->getIDocumentSettingAccess();
const bool bTreatSingleColumnBreakAsPageBreak = rIDSA.get(DocumentSettingId::TREAT_SINGLE_COLUMN_BREAK_AS_PAGE_BREAK);
- const SvxBreak eBreak = pSet->GetBreak().GetBreak();
+ const SvxBreak eBreak = m_rThis.GetBreakItem().GetBreak();
if ( eBreak == SvxBreak::PageBefore ||
eBreak == SvxBreak::PageBoth ||
( bTreatSingleColumnBreakAsPageBreak && eBreak == SvxBreak::ColumnBefore && !m_rThis.FindColFrame() ))
return true;
else
{
- const SvxBreak &ePrB = pPrev->GetAttrSet()->GetBreak().GetBreak();
+ const SvxBreak &ePrB = pPrev->GetBreakItem().GetBreak();
if ( ePrB == SvxBreak::PageAfter ||
ePrB == SvxBreak::PageBoth ||
- pSet->GetPageDesc().GetPageDesc() )
+ m_rThis.GetPageDescItem().GetPageDesc())
+ {
return true;
+ }
}
}
}
@@ -1208,13 +1210,13 @@ bool SwFlowFrame::IsColBreak( bool bAct ) const
return false;
}
- const SvxBreak eBreak = m_rThis.GetAttrSet()->GetBreak().GetBreak();
+ const SvxBreak eBreak = m_rThis.GetBreakItem().GetBreak();
if ( eBreak == SvxBreak::ColumnBefore ||
eBreak == SvxBreak::ColumnBoth )
return true;
else
{
- const SvxBreak &ePrB = pPrev->GetAttrSet()->GetBreak().GetBreak();
+ const SvxBreak &ePrB = pPrev->GetBreakItem().GetBreak();
if ( ePrB == SvxBreak::ColumnAfter ||
ePrB == SvxBreak::ColumnBoth )
return true;
@@ -1998,7 +2000,7 @@ bool SwFlowFrame::MoveFwd( bool bMakePage, bool bPageBreak, bool bMoveAlways )
// #i106452#
// check page description not only in situation with sections.
if ( !bSamePage &&
- ( m_rThis.GetAttrSet()->GetPageDesc().GetPageDesc() ||
+ ( m_rThis.GetPageDescItem().GetPageDesc() ||
pOldPage->GetPageDesc()->GetFollow() != pNewPage->GetPageDesc() ) )
{
SwFrame::CheckPageDescs( pNewPage, false );
@@ -2545,7 +2547,7 @@ bool SwFlowFrame::MoveBwd( bool &rbReformat )
static_cast<SwPageFrame*>(pNewPage->GetNext());
SwFrame::CheckPageDescs( pStartPage, false);
}
- else if ( m_rThis.GetAttrSet()->GetPageDesc().GetPageDesc() )
+ else if (m_rThis.GetPageDescItem().GetPageDesc())
{
// First page could get empty for example by disabling
// a section
diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx
index 992dcfd52789..73c38c19f4eb 100644
--- a/sw/source/core/layout/laycache.cxx
+++ b/sw/source/core/layout/laycache.cxx
@@ -630,9 +630,8 @@ sal_uLong SwLayHelper::CalcPageCount()
bool SwLayHelper::CheckInsertPage()
{
bool bEnd = nullptr == mrpPage->GetNext();
- const SwAttrSet* pAttr = mrpFrame->GetAttrSet();
- const SvxFormatBreakItem& rBrk = pAttr->GetBreak();
- const SwFormatPageDesc& rDesc = pAttr->GetPageDesc();
+ const SvxFormatBreakItem& rBrk = mrpFrame->GetBreakItem();
+ const SwFormatPageDesc& rDesc = mrpFrame->GetPageDescItem();
// #118195# Do not evaluate page description if frame
// is a follow frame!
const SwPageDesc* pDesc = mrpFrame->IsFlowFrame() &&
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index 11095f1dec62..036e3371e97c 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -770,7 +770,7 @@ SwPageDesc *SwPageFrame::FindPageDesc()
SwFrame *pFlow = pFrame;
if ( pFlow->IsInTab() )
pFlow = pFlow->FindTabFrame();
- pRet = const_cast<SwPageDesc*>(pFlow->GetAttrSet()->GetPageDesc().GetPageDesc());
+ pRet = const_cast<SwPageDesc*>(pFlow->GetPageDescItem().GetPageDesc());
}
if ( !pRet )
pRet = &GetFormat()->GetDoc()->GetPageDesc( 0 );
@@ -786,7 +786,7 @@ SwPageDesc *SwPageFrame::FindPageDesc()
{
SwFlowFrame *pTmp = SwFlowFrame::CastFlowFrame( pFlow );
if ( !pTmp->IsFollow() )
- pRet = const_cast<SwPageDesc*>(pFlow->GetAttrSet()->GetPageDesc().GetPageDesc());
+ pRet = const_cast<SwPageDesc*>(pFlow->GetPageDescItem().GetPageDesc());
}
//3. and 3.1
@@ -1288,7 +1288,8 @@ SwPageFrame *SwFrame::InsertPage( SwPageFrame *pPrevPage, bool bFootnote )
// For ContentFrame take the one from format if provided,
// otherwise from the Follow of the PrevPage
if ( IsFlowFrame() && !SwFlowFrame::CastFlowFrame( this )->IsFollow() )
- { SwFormatPageDesc &rDesc = const_cast<SwFormatPageDesc&>(GetAttrSet()->GetPageDesc());
+ {
+ SwFormatPageDesc &rDesc = const_cast<SwFormatPageDesc&>(GetPageDescItem());
pDesc = rDesc.GetPageDesc();
if ( rDesc.GetNumOffset() )
{
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index 843b8b2f1936..716206df0ac3 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -1728,7 +1728,7 @@ bool SwFrame::WannaRightPage() const
const SwFlowFrame *pTmp = SwFlowFrame::CastFlowFrame( pFlow );
if ( !pTmp->IsFollow() )
{
- const SwFormatPageDesc& rPgDesc = pFlow->GetAttrSet()->GetPageDesc();
+ const SwFormatPageDesc& rPgDesc = pFlow->GetPageDescItem();
pDesc = rPgDesc.GetPageDesc();
oPgNum = rPgDesc.GetNumOffset();
}
@@ -1854,7 +1854,7 @@ sal_uInt16 SwFrame::GetVirtPageNum() const
}
if ( pFrame )
{
- ::boost::optional<sal_uInt16> oNumOffset = pFrame->GetAttrSet()->GetPageDesc().GetNumOffset();
+ ::boost::optional<sal_uInt16> oNumOffset = pFrame->GetPageDescItem().GetNumOffset();
if (oNumOffset)
{
return nPhyPage - pFrame->GetPhyPageNum() + oNumOffset.get();
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index fed5c5daf312..2406868f5c4c 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -2382,7 +2382,7 @@ void SwContentFrame::UpdateAttr_( const SfxPoolItem* pOld, const SfxPoolItem* pN
SwPageFrame *pPage = FindPageFrame();
if ( !GetPrev() )
CheckPageDescs( pPage );
- if ( GetAttrSet()->GetPageDesc().GetNumOffset() )
+ if (GetPageDescItem().GetNumOffset())
static_cast<SwRootFrame*>(pPage->GetUpper())->SetVirtPageNum( true );
SwDocPosUpdate aMsgHint( pPage->getFrameArea().Top() );
pPage->GetFormat()->GetDoc()->getIDocumentFieldsAccess().UpdatePageFields( &aMsgHint );
commit d3e5e21407efbc459b16dd147135b73df3549f8e
Author: Michael Stahl <Michael.Stahl at cib.de>
Date: Fri Jun 1 21:53:39 2018 +0200
sw_redlinehide: refactor SwFlowFrame::IsKeep()
This thing uses 2 items, a normal one and RES_BREAK, so they need to be
passed in separately, a merged text frame does not necessarily have any
item set with the matching items.
Change-Id: I5e50ac60137ba8d94adeaee2ef015551d8a3bdd8
diff --git a/sw/source/core/inc/flowfrm.hxx b/sw/source/core/inc/flowfrm.hxx
index 818f0fb4f597..6f08a70bd39f 100644
--- a/sw/source/core/inc/flowfrm.hxx
+++ b/sw/source/core/inc/flowfrm.hxx
@@ -22,6 +22,8 @@
#include "frmtool.hxx"
+class SvxFormatKeepItem;
+class SvxFormatBreakItem;
class SwPageFrame;
class SwRect;
class SwBorderAttrs;
@@ -177,7 +179,9 @@ public:
bool IsColBreak( bool bAct ) const;
/** method to determine if a Keep needs to be considered (Breaks!) */
- bool IsKeep( const SwAttrSet& rAttrs, bool bBreakCheck = false ) const;
+ bool IsKeep(SvxFormatKeepItem const& rKeep,
+ SvxFormatBreakItem const& rBreak,
+ bool bBreakCheck = false ) const;
bool HasLockedFollow() const;
diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx
index c00b5efe1758..2b56272bf49c 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -1214,7 +1214,7 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/)
pNotify->SetBordersJoinedWithPrev();
}
- const bool bKeep = IsKeep( rAttrs.GetAttrSet() );
+ const bool bKeep = IsKeep(rAttrs.GetAttrSet().GetKeep(), GetBreakItem());
SwSaveFootnoteHeight *pSaveFootnote = nullptr;
if ( bFootnote )
@@ -2092,7 +2092,7 @@ bool SwContentFrame::WouldFit_( SwTwips nSpace,
}
}
- if ( bRet && !bSplit && pFrame->IsKeep( rAttrs.GetAttrSet() ) )
+ if (bRet && !bSplit && pFrame->IsKeep(rAttrs.GetAttrSet().GetKeep(), GetBreakItem()))
{
if( bTstMove )
{
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx
index 952708ae0342..d7c651a7c597 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -41,6 +41,7 @@
#include <paratr.hxx>
#include <ftnfrm.hxx>
#include <txtfrm.hxx>
+#include <notxtfrm.hxx>
#include <tabfrm.hxx>
#include <pagedesc.hxx>
#include <layact.hxx>
@@ -169,7 +170,9 @@ void SwFlowFrame::CheckKeep()
pPre->InvalidatePos();
}
-bool SwFlowFrame::IsKeep( const SwAttrSet& rAttrs, bool bCheckIfLastRowShouldKeep ) const
+bool SwFlowFrame::IsKeep(SvxFormatKeepItem const& rKeep,
+ SvxFormatBreakItem const& rBreak,
+ bool const bCheckIfLastRowShouldKeep) const
{
// 1. The keep attribute is ignored inside footnotes
// 2. For compatibility reasons, the keep attribute is
@@ -180,7 +183,7 @@ bool SwFlowFrame::IsKeep( const SwAttrSet& rAttrs, bool bCheckIfLastRowShouldKee
bool bKeep = bCheckIfLastRowShouldKeep ||
( !m_rThis.IsInFootnote() &&
( !m_rThis.IsInTab() || m_rThis.IsTabFrame() ) &&
- rAttrs.GetKeep().GetValue() );
+ rKeep.GetValue() );
OSL_ENSURE( !bCheckIfLastRowShouldKeep || m_rThis.IsTabFrame(),
"IsKeep with bCheckIfLastRowShouldKeep should only be used for tabfrms" );
@@ -188,7 +191,7 @@ bool SwFlowFrame::IsKeep( const SwAttrSet& rAttrs, bool bCheckIfLastRowShouldKee
// Ignore keep attribute if there are break situations:
if ( bKeep )
{
- switch ( rAttrs.GetBreak().GetBreak() )
+ switch (rBreak.GetBreak())
{
case SvxBreak::ColumnAfter:
case SvxBreak::ColumnBoth:
@@ -227,23 +230,24 @@ bool SwFlowFrame::IsKeep( const SwAttrSet& rAttrs, bool bCheckIfLastRowShouldKee
if ( bKeep )
{
- const SwAttrSet* pSet = nullptr;
-
+ SvxFormatBreakItem const* pBreak;
+ SwFormatPageDesc const* pPageDesc;
SwTabFrame* pTab = pNxt->IsInTab() ? pNxt->FindTabFrame() : nullptr;
- if (pTab)
+ if (pTab && (!m_rThis.IsInTab() || m_rThis.FindTabFrame() != pTab))
{
- if ( ! m_rThis.IsInTab() || m_rThis.FindTabFrame() != pTab )
- pSet = &pTab->GetFormat()->GetAttrSet();
+ const SwAttrSet *const pSet = &pTab->GetFormat()->GetAttrSet();
+ pBreak = &pSet->GetBreak();
+ pPageDesc = &pSet->GetPageDesc();
+ }
+ else
+ {
+ pBreak = &pNxt->GetBreakItem();
+ pPageDesc = &pNxt->GetPageDescItem();
}
- if ( ! pSet )
- pSet = pNxt->GetAttrSet();
-
- assert(pSet && "No AttrSet to check keep attribute");
-
- if ( pSet->GetPageDesc().GetPageDesc() )
+ if (pPageDesc->GetPageDesc())
bKeep = false;
- else switch ( pSet->GetBreak().GetBreak() )
+ else switch (pBreak->GetBreak())
{
case SvxBreak::ColumnBefore:
case SvxBreak::ColumnBoth:
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index faba4d0e1aa4..74a2f6201e4b 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -1457,7 +1457,7 @@ void CalcContent( SwLayoutFrame *pLay, bool bNoColl )
!pTmpFlowFrame->IsJoinLocked() &&
!pTmpPrev->isFrameAreaPositionValid() &&
pLay->IsAnLower( pTmpPrev ) &&
- pTmpPrevFlowFrame->IsKeep( *pTmpPrev->GetAttrSet() ) &&
+ pTmpPrevFlowFrame->IsKeep(pTmpPrev->GetAttrSet()->GetKeep(), pTmpPrev->GetBreakItem()) &&
pTmpPrevFlowFrame->IsKeepFwdMoveAllowed();
// format floating screen objects anchored to the frame.
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index 6552f45a6e0a..bfdb15bc1a86 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -125,7 +125,8 @@ SwFrameNotify::~SwFrameNotify() COVERITY_NOEXCEPT_FALSE
if ( pPre && pPre->IsFlowFrame() )
{
// 1. pPre wants to keep with me:
- bool bInvalidPrePos = SwFlowFrame::CastFlowFrame( pPre )->IsKeep( *pPre->GetAttrSet() ) && pPre->GetIndPrev();
+ bool bInvalidPrePos = SwFlowFrame::CastFlowFrame(pPre)->IsKeep(pPre->GetAttrSet()->GetKeep(), pPre->GetBreakItem())
+ && pPre->GetIndPrev();
// 2. pPre is a table and the last row wants to keep with me:
if ( !bInvalidPrePos && pPre->IsTabFrame() )
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 501d756f714f..43723ef67518 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -1859,7 +1859,7 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext)
// The beloved keep attribute
const bool bEmulateTableKeep = AreAllRowsKeepWithNext( GetFirstNonHeadlineRow() );
- const bool bKeep = IsKeep( pAttrs->GetAttrSet(), bEmulateTableKeep );
+ const bool bKeep = IsKeep(pAttrs->GetAttrSet().GetKeep(), GetBreakItem(), bEmulateTableKeep);
// All rows should keep together
const bool bDontSplit = !IsFollow() &&
@@ -2225,9 +2225,12 @@ void SwTabFrame::MakeAll(vcl::RenderContext* pRenderContext)
// 6. There is no section change behind the table (see IsKeep)
// 7. The last table row wants to keep with its next.
const SwRowFrame* pLastRow = static_cast<const SwRowFrame*>(GetLastLower());
- if ( pLastRow && IsKeep( pAttrs->GetAttrSet(), true ) &&
- pLastRow->ShouldRowKeepWithNext() )
+ if (pLastRow
+ && IsKeep(pAttrs->GetAttrSet().GetKeep(), GetBreakItem(), true)
+ && pLastRow->ShouldRowKeepWithNext())
+ {
bFormat = true;
+ }
}
if ( bFormat )
commit b2f7a659a3ccfbe8bc9ac6c4597f9f6977cffd55
Author: Michael Stahl <Michael.Stahl at cib.de>
Date: Fri Jun 1 21:45:07 2018 +0200
sw_redlinehide: add SwFrame::GetBreakItem()/GetPageDescItem()
SwFrame::GetAttrSet() can work for merged text frame for most
paragraph/frame items, but not for these two, which are special cased
in the node joining code so they're always from the first node.
Change-Id: Ib63203a67e15e208aa50bc46ae0f5a82d1b9081c
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index eea4f733bc30..4f6375d664a9 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -51,6 +51,8 @@ class Color;
class SwBorderAttrs;
class SwCache;
class SvxBrushItem;
+class SvxFormatBreakItem;
+class SwFormatPageDesc;
class SwSelectionList;
struct SwPosition;
struct SwCursorMoveState;
@@ -631,7 +633,11 @@ public:
void ReinitializeFrameSizeAttrFlags();
+ /// WARNING: this may not return correct RES_PAGEDESC/RES_BREAK items for
+ /// SwTextFrame, use GetBreakItem()/GetPageDescItem() instead
const SwAttrSet *GetAttrSet() const;
+ virtual const SvxFormatBreakItem& GetBreakItem() const;
+ virtual const SwFormatPageDesc& GetPageDescItem() const;
bool HasFixSize() const { return mbFixSize; }
diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx
index 4da3d55817c1..9ace62c83b20 100644
--- a/sw/source/core/inc/txtfrm.hxx
+++ b/sw/source/core/inc/txtfrm.hxx
@@ -269,6 +269,9 @@ protected:
public:
+ virtual const SvxFormatBreakItem& GetBreakItem() const override;
+ virtual const SwFormatPageDesc& GetPageDescItem() const override;
+
css::uno::Sequence< css::style::TabStop > GetTabStopInfo( SwTwips CurrentPos ) override;
/**
diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx
index baca3edfa189..b720d9936a45 100644
--- a/sw/source/core/layout/findfrm.cxx
+++ b/sw/source/core/layout/findfrm.cxx
@@ -22,13 +22,14 @@
#include <cellfrm.hxx>
#include <rowfrm.hxx>
#include <swtable.hxx>
-
+#include <notxtfrm.hxx>
#include <tabfrm.hxx>
#include <sectfrm.hxx>
#include <flyfrms.hxx>
#include <ftnfrm.hxx>
#include <txtftn.hxx>
#include <fmtftn.hxx>
+#include <fmtpdsc.hxx>
#include <txtfrm.hxx>
#include <calbck.hxx>
#include <viewopt.hxx>
@@ -621,19 +622,52 @@ bool SwRootFrame::IsBetweenPages(const Point& rPt) const
return false;
}
+const SvxFormatBreakItem& SwFrame::GetBreakItem() const
+{
+ return GetAttrSet()->GetBreak();
+}
+
+const SwFormatPageDesc& SwFrame::GetPageDescItem() const
+{
+ return GetAttrSet()->GetPageDesc();
+}
+
+const SvxFormatBreakItem& SwTextFrame::GetBreakItem() const
+{
+ return GetTextNodeFirst()->GetSwAttrSet().GetBreak();
+}
+
+const SwFormatPageDesc& SwTextFrame::GetPageDescItem() const
+{
+ return GetTextNodeFirst()->GetSwAttrSet().GetPageDesc();
+}
+
const SwAttrSet* SwFrame::GetAttrSet() const
{
- if ( IsContentFrame() )
- return &static_cast<const SwContentFrame*>(this)->GetNode()->GetSwAttrSet();
+ if (IsTextFrame())
+ {
+ return &static_cast<const SwTextFrame*>(this)->GetTextNodeForParaProps()->GetSwAttrSet();
+ }
+ else if (IsNoTextFrame())
+ {
+ return &static_cast<const SwNoTextFrame*>(this)->GetNode()->GetSwAttrSet();
+ }
else
+ {
+ assert(IsLayoutFrame());
return &static_cast<const SwLayoutFrame*>(this)->GetFormat()->GetAttrSet();
+ }
}
drawinglayer::attribute::SdrAllFillAttributesHelperPtr SwFrame::getSdrAllFillAttributesHelper() const
{
- if(IsContentFrame())
+ if (IsTextFrame())
+ {
+ return static_cast<const SwTextFrame*>(this)->GetTextNodeForParaProps()->getSdrAllFillAttributesHelper();
+ }
+ else if (IsNoTextFrame())
{
- return static_cast< const SwContentFrame* >(this)->GetNode()->getSdrAllFillAttributesHelper();
+ return static_cast<const SwNoTextFrame*>(this)->GetNode()->getSdrAllFillAttributesHelper();
}
else
{
commit ad003b09d23155612277c72032f8e941d462ccf3
Author: Michael Stahl <Michael.Stahl at cib.de>
Date: Fri Jun 1 21:39:15 2018 +0200
sw_redlinehide: add sw::FrameContainsNode()
Change-Id: I13fde1bc95211ecbf5ff2a3f54cd85f41b5418d7
diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx
index 2f52ca6865e5..4da3d55817c1 100644
--- a/sw/source/core/inc/txtfrm.hxx
+++ b/sw/source/core/inc/txtfrm.hxx
@@ -95,6 +95,8 @@ TextFrameIndex MapModelToView(MergedPara const&, SwTextNode const* pNode, sal_In
std::unique_ptr<sw::MergedPara> CheckParaRedlineMerge(SwTextFrame & rFrame, SwTextNode & rTextNode);
+bool FrameContainsNode(SwContentFrame const& rFrame, sal_uLong nNodeIndex);
+
} // namespace sw
/// Represents the visualization of a paragraph. Typical upper is an
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index cd83401e19de..87ff04e46886 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -59,6 +59,7 @@
#include <ftninfo.hxx>
#include <fmtline.hxx>
#include <txtfrm.hxx>
+#include <notxtfrm.hxx>
#include <sectfrm.hxx>
#include "itrform2.hxx"
#include "widorp.hxx"
@@ -282,6 +283,34 @@ namespace sw {
}
}
+ bool FrameContainsNode(SwContentFrame const& rFrame, sal_uLong const nNodeIndex)
+ {
+ if (rFrame.IsTextFrame())
+ {
+ SwTextFrame const& rTextFrame(static_cast<SwTextFrame const&>(rFrame));
+ if (sw::MergedPara const*const pMerged = rTextFrame.GetMergedPara())
+ {
+ sal_uLong const nFirst(pMerged->pFirstNode->GetIndex());
+ sal_uLong nLast(nFirst);
+ // FIXME is this actually the last one? what about delete RL that dels last node until end, what happens to its anchored objs?
+ if (!pMerged->extents.empty())
+ {
+ nLast = pMerged->extents.back().pNode->GetIndex();
+ }
+ return (nFirst <= nNodeIndex && nNodeIndex <= nLast);
+ }
+ else
+ {
+ return rTextFrame.GetTextNodeFirst()->GetIndex() == nNodeIndex;
+ }
+ }
+ else
+ {
+ assert(rFrame.IsNoTextFrame());
+ return static_cast<SwNoTextFrame const&>(rFrame).GetNode()->GetIndex() == nNodeIndex;
+ }
+ }
+
} // namespace sw
/// Switches width and height of the text frame
@@ -1083,7 +1112,7 @@ bool sw_HideObj( const SwTextFrame& _rFrame,
_rFrame.IsInDocBody() && !_rFrame.FindNextCnt() )
{
SwTextNode const& rNode(*rAnchorPos.nNode.GetNode().GetTextNode());
-// assert(_rFrame.GetMergedPara() || &rNode == _rFrame.GetDep()); // simple consistency check
+ assert(FrameContainsNode(_rFrame, rNode.GetIndex()));
sal_Int32 const nObjAnchorPos(rAnchorPos.nContent.GetIndex());
const sal_Unicode cAnchorChar = nObjAnchorPos < rNode.Len()
? rNode.GetText()[nObjAnchorPos]
commit b822b796ddf737ec17050ea63b7ca81dbbf4681c
Author: Michael Stahl <Michael.Stahl at cib.de>
Date: Fri Jun 1 21:32:22 2018 +0200
sw_redlinehide: SwContentFrame::LeftMargin()/RightMargin() pure virtual
... because it's using GetNode().
Change-Id: Iba99a2c4213d389e8b281b689f7bcfc6027baf28
diff --git a/sw/source/core/inc/cntfrm.hxx b/sw/source/core/inc/cntfrm.hxx
index cf3eae039e84..62413e38de8c 100644
--- a/sw/source/core/inc/cntfrm.hxx
+++ b/sw/source/core/inc/cntfrm.hxx
@@ -79,8 +79,8 @@ public:
SwTextFrame* FindMaster() const;
// layout dependent cursor travelling
- virtual bool LeftMargin( SwPaM * ) const;
- virtual bool RightMargin( SwPaM *, bool bAPI = false ) const;
+ virtual bool LeftMargin(SwPaM *) const = 0;
+ virtual bool RightMargin(SwPaM *, bool bAPI = false) const = 0;
virtual bool UnitUp( SwPaM *, const SwTwips nOffset,
bool bSetInReadOnly ) const;
virtual bool UnitDown( SwPaM *, const SwTwips nOffset,
diff --git a/sw/source/core/inc/notxtfrm.hxx b/sw/source/core/inc/notxtfrm.hxx
index 8685aa948895..9de5fd31abfe 100644
--- a/sw/source/core/inc/notxtfrm.hxx
+++ b/sw/source/core/inc/notxtfrm.hxx
@@ -54,6 +54,9 @@ protected:
public:
SwNoTextFrame( SwNoTextNode * const, SwFrame* );
+ virtual bool LeftMargin(SwPaM *) const override;
+ virtual bool RightMargin(SwPaM *, bool bAPI = false) const override;
+
virtual void PaintSwFrame( vcl::RenderContext& rRenderContext, SwRect const&,
SwPrintData const*const pPrintData = nullptr ) const override;
virtual bool GetCharRect( SwRect &, const SwPosition&,
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index d4a9bf5c8ddf..843b8b2f1936 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -615,7 +615,7 @@ bool SwFlyFrame::GetCursorOfst( SwPosition *pPos, Point &rPoint,
}
/** Layout dependent cursor travelling */
-bool SwContentFrame::LeftMargin(SwPaM *pPam) const
+bool SwNoTextFrame::LeftMargin(SwPaM *pPam) const
{
if( &pPam->GetNode() != GetNode() )
return false;
@@ -624,7 +624,7 @@ bool SwContentFrame::LeftMargin(SwPaM *pPam) const
return true;
}
-bool SwContentFrame::RightMargin(SwPaM *pPam, bool) const
+bool SwNoTextFrame::RightMargin(SwPaM *pPam, bool) const
{
if( &pPam->GetNode() != GetNode() )
return false;
diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx
index c57764acb569..64b4721f3bab 100644
--- a/sw/source/core/text/frmcrsr.cxx
+++ b/sw/source/core/text/frmcrsr.cxx
@@ -670,7 +670,7 @@ bool SwTextFrame::GetCursorOfst(SwPosition* pPos, Point& rPoint,
bool SwTextFrame::LeftMargin(SwPaM *pPam) const
{
- assert(&pPam->GetNode() == GetNode() || GetMergedPara());
+ assert(GetMergedPara() || &pPam->GetNode() == static_cast<SwContentNode const*>(GetDep()));
SwTextFrame *pFrame = GetAdjFrameAtPos( const_cast<SwTextFrame*>(this), *pPam->GetPoint(),
SwTextCursor::IsRightMargin() );
@@ -704,7 +704,7 @@ bool SwTextFrame::LeftMargin(SwPaM *pPam) const
bool SwTextFrame::RightMargin(SwPaM *pPam, bool bAPI) const
{
- assert(&pPam->GetNode() == GetNode() || GetMergedPara());
+ assert(GetMergedPara() || &pPam->GetNode() == static_cast<SwContentNode const*>(GetDep()));
SwTextFrame *pFrame = GetAdjFrameAtPos( const_cast<SwTextFrame*>(this), *pPam->GetPoint(),
SwTextCursor::IsRightMargin() );
commit 2c56dacd8fde33aa7f087156ab9993561a16cf43
Author: Michael Stahl <Michael.Stahl at cib.de>
Date: Fri Jun 1 21:24:11 2018 +0200
sw_redlinehide: make GetRegisteredIn() private in SwFrame
Use GetDep() instead, which is a unique identifier in sw.
Change-Id: I66e60a175165673c2962124fdec691b03a5f0e4a
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index 482f60c8dca0..eea4f733bc30 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -313,6 +313,10 @@ class SW_DLLPUBLIC SwFrame : public SwFrameAreaDefinition, public SwClient, publ
SwFrame *mpNext;
SwFrame *mpPrev;
+ // sw_redlinehide: hide these dangerous SwClient functions
+ using SwClient::GetRegisteredInNonConst;
+ using SwClient::GetRegisteredIn;
+
SwFrame *FindNext_();
SwFrame *FindPrev_();
@@ -441,6 +445,8 @@ protected:
virtual SwTwips ShrinkFrame( SwTwips, bool bTst = false, bool bInfo = false ) = 0;
virtual SwTwips GrowFrame ( SwTwips, bool bTst = false, bool bInfo = false ) = 0;
+ /// use these so we can grep for SwFrame's GetRegisteredIn accesses
+ /// beware that SwTextFrame may return sw::WriterMultiListener
SwModify *GetDep() { return GetRegisteredInNonConst(); }
const SwModify *GetDep() const { return GetRegisteredIn(); }
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index ada88221eadc..cd83401e19de 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -1083,7 +1083,7 @@ bool sw_HideObj( const SwTextFrame& _rFrame,
_rFrame.IsInDocBody() && !_rFrame.FindNextCnt() )
{
SwTextNode const& rNode(*rAnchorPos.nNode.GetNode().GetTextNode());
- assert(_rFrame.GetMergedPara() || &rNode == _rFrame.GetRegisteredIn()); // simple consistency check
+// assert(_rFrame.GetMergedPara() || &rNode == _rFrame.GetDep()); // simple consistency check
sal_Int32 const nObjAnchorPos(rAnchorPos.nContent.GetIndex());
const sal_Unicode cAnchorChar = nObjAnchorPos < rNode.Len()
? rNode.GetText()[nObjAnchorPos]
commit 5e2bd5f4aed9e507ca6d65bb2243392be90d79f6
Author: Michael Stahl <Michael.Stahl at cib.de>
Date: Fri Jun 1 21:19:07 2018 +0200
sw_redlinehide: SwContentFrame::DestroyImpl()
Change-Id: I4539ef0a7dc04de1c87cf6f54ca319dbdc719755
diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx
index ea5108f1a848..3012bd954a94 100644
--- a/sw/source/core/layout/ssfrm.cxx
+++ b/sw/source/core/layout/ssfrm.cxx
@@ -414,9 +414,14 @@ SwContentFrame::SwContentFrame( SwContentNode * const pContent, SwFrame* pSib )
void SwContentFrame::DestroyImpl()
{
- const SwContentNode* pCNd;
- if( nullptr != ( pCNd = dynamic_cast<SwContentNode*>( GetRegisteredIn() ) ) &&
- !pCNd->GetDoc()->IsInDtor() )
+ const SwContentNode* pCNd(dynamic_cast<SwContentNode*>(GetDep()));
+ if (nullptr == pCNd && IsTextFrame())
+ {
+ pCNd = static_cast<SwTextFrame*>(this)->GetTextNodeFirst();
+ }
+ // IsInDtor shouldn't be happening with ViewShell owning layout
+ assert(nullptr == pCNd || !pCNd->GetDoc()->IsInDtor());
+ if (nullptr != pCNd && !pCNd->GetDoc()->IsInDtor())
{
//Unregister from root if I'm still in turbo there.
SwRootFrame *pRoot = getRootFrame();
commit 3081308df10905bd6087e943d36c9d5118f62256
Author: Michael Stahl <Michael.Stahl at cib.de>
Date: Fri Jun 1 20:52:35 2018 +0200
sw_redlinehide: convert to GetDep()
Change-Id: I3b128fe797e8fd6989821cfd540dc5e630e74d37
diff --git a/sw/source/core/layout/hffrm.cxx b/sw/source/core/layout/hffrm.cxx
index c2d2a46718c6..437b8992a243 100644
--- a/sw/source/core/layout/hffrm.cxx
+++ b/sw/source/core/layout/hffrm.cxx
@@ -688,7 +688,7 @@ void SwPageFrame::PrepareHeader()
if ( !pLay )
return;
- const SwFormatHeader &rH = static_cast<SwFrameFormat*>(GetRegisteredIn())->GetHeader();
+ const SwFormatHeader &rH = static_cast<SwFrameFormat*>(GetDep())->GetHeader();
const SwViewShell *pSh = getRootFrame()->GetCurrShell();
const bool bOn = !(pSh && (pSh->GetViewOptions()->getBrowseMode() ||
@@ -729,7 +729,7 @@ void SwPageFrame::PrepareFooter()
if ( !pLay )
return;
- const SwFormatFooter &rF = static_cast<SwFrameFormat*>(GetRegisteredIn())->GetFooter();
+ const SwFormatFooter &rF = static_cast<SwFrameFormat*>(GetDep())->GetFooter();
while ( pLay->GetNext() )
pLay = static_cast<SwLayoutFrame*>(pLay->GetNext());
diff --git a/sw/source/core/layout/newfrm.cxx b/sw/source/core/layout/newfrm.cxx
index ced2ab2b407e..37bea6e97e65 100644
--- a/sw/source/core/layout/newfrm.cxx
+++ b/sw/source/core/layout/newfrm.cxx
@@ -472,7 +472,7 @@ void SwRootFrame::DestroyImpl()
if(pBlink)
pBlink->FrameDelete( this );
- SwFrameFormat *pRegisteredInNonConst = static_cast<SwFrameFormat*>(GetRegisteredInNonConst());
+ SwFrameFormat *pRegisteredInNonConst = static_cast<SwFrameFormat*>(GetDep());
if ( pRegisteredInNonConst )
{
SwDoc *pDoc = pRegisteredInNonConst->GetDoc();
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index 653a58097f7a..11095f1dec62 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -2451,7 +2451,7 @@ bool SwPageFrame::IsOverHeaderFooterArea( const Point& rPt, FrameControlType &rC
const bool bHideWhitespaceMode = pViewShell->GetViewOptions()->IsHideWhitespaceMode();
if ( aHeaderArea.IsInside( rPt ) )
{
- if (!bHideWhitespaceMode || static_cast<const SwFrameFormat*>(GetRegisteredIn())->GetHeader().IsActive())
+ if (!bHideWhitespaceMode || static_cast<const SwFrameFormat*>(GetDep())->GetHeader().IsActive())
{
rControl = Header;
return true;
@@ -2463,7 +2463,7 @@ bool SwPageFrame::IsOverHeaderFooterArea( const Point& rPt, FrameControlType &rC
Size( getFrameArea().Width(), getFrameArea().Bottom() - nLowerLimit ) );
if ( aFooterArea.IsInside( rPt ) &&
- (!bHideWhitespaceMode || static_cast<const SwFrameFormat*>(GetRegisteredIn())->GetFooter().IsActive()) )
+ (!bHideWhitespaceMode || static_cast<const SwFrameFormat*>(GetDep())->GetFooter().IsActive()) )
{
rControl = Footer;
return true;
@@ -2488,7 +2488,7 @@ bool SwPageFrame::CheckPageHeightValidForHideWhitespace(SwTwips nDiff)
if (nDiff < 0)
{
// Content frame doesn't fit the actual size, check if it fits the nominal one.
- const SwFrameFormat* pPageFormat = static_cast<const SwFrameFormat*>(GetRegisteredIn());
+ const SwFrameFormat* pPageFormat = static_cast<const SwFrameFormat*>(GetDep());
const Size& rPageSize = pPageFormat->GetFrameSize().GetSize();
long nWhitespace = rPageSize.getHeight() - getFrameArea().Height();
if (nWhitespace > -nDiff)
diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index 8f68adf082c7..b12952b0114a 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -2556,7 +2556,7 @@ void SwSectionFrame::SwClientNotify( const SwModify& rMod, const SfxHint& rHint
// #i117863#
const SwSectionFrameMoveAndDeleteHint* pHint =
dynamic_cast<const SwSectionFrameMoveAndDeleteHint*>(&rHint);
- if ( pHint && pHint->GetId() == SfxHintId::Dying && &rMod == GetRegisteredIn() )
+ if (pHint && pHint->GetId() == SfxHintId::Dying && &rMod == GetDep())
{
SwSectionFrame::MoveContentAndDelete( this, pHint->IsSaveContent() );
}
diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx
index a0b035ebaee7..ea5108f1a848 100644
--- a/sw/source/core/layout/ssfrm.cxx
+++ b/sw/source/core/layout/ssfrm.cxx
@@ -436,7 +436,7 @@ SwContentFrame::~SwContentFrame()
void SwTextFrame::RegisterToNode(SwTextNode & rNode)
{
- assert(&rNode != GetRegisteredIn());
+ assert(&rNode != GetDep());
m_pMergedPara = sw::CheckParaRedlineMerge(*this, rNode);
rNode.Add( this );
}
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 90cc289b2b21..501d756f714f 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -1480,12 +1480,14 @@ bool SwContentFrame::CalcLowers( SwLayoutFrame* pLay, const SwLayoutFrame* pDont
if ( !SwObjectFormatter::FormatObjsAtFrame( *pCnt,
*(pCnt->FindPageFrame()) ) )
{
- if ( pCnt->GetRegisteredIn() == pLoopControlCond )
+ SwTextNode const*const pTextNode(
+ static_cast<SwTextFrame*>(pCnt)->GetTextNodeFirst());
+ if (pTextNode == pLoopControlCond)
++nLoopControlRuns;
else
{
nLoopControlRuns = 0;
- pLoopControlCond = pCnt->GetRegisteredIn();
+ pLoopControlCond = pTextNode;
}
if ( nLoopControlRuns < nLoopControlMax )
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index 88f47d89fa6f..ada88221eadc 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -651,7 +651,7 @@ void SwTextFrame::DestroyImpl()
}
else
{
- SwTextNode *const pNode(static_cast<SwTextNode*>(GetRegisteredIn()));
+ SwTextNode *const pNode(static_cast<SwTextNode*>(GetDep()));
if (pNode)
{
RemoveFootnotesForNode(*this, *pNode);
commit 9ad71142acf6ab68fd40307a254b1d7638513b51
Author: Michael Stahl <Michael.Stahl at cib.de>
Date: Fri Jun 1 20:46:26 2018 +0200
sw_redlinehide: convert SwDeletionChecker to GetDep()
Such a lovely class!
Change-Id: Id03795b1c62c35829cab093198daf082ca78d174
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index b9d90f9a0f37..482f60c8dca0 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -287,6 +287,7 @@ class SW_DLLPUBLIC SwFrame : public SwFrameAreaDefinition, public SwClient, publ
friend class SwFlowFrame;
friend class SwLayoutFrame;
friend class SwLooping;
+ friend class SwDeletionChecker; // for GetDep()
// voids lower during creation of a column
friend SwFrame *SaveContent( SwLayoutFrame *, SwFrame* pStart );
diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx
index c0ecd3463b02..0ffe4a75c0f6 100644
--- a/sw/source/core/inc/frmtool.hxx
+++ b/sw/source/core/inc/frmtool.hxx
@@ -544,11 +544,7 @@ private:
const SwModify* mpRegIn;
public:
- SwDeletionChecker( const SwFrame* pFrame )
- : mpFrame( pFrame ),
- mpRegIn( pFrame ? const_cast<SwFrame*>(pFrame)->GetRegisteredIn() : nullptr )
- {
- }
+ SwDeletionChecker(const SwFrame* pFrame);
/**
* return
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index 277d155d06aa..6552f45a6e0a 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -3418,6 +3418,17 @@ const SwContentFrame* GetCellContent( const SwLayoutFrame& rCell )
return pContent;
}
+SwDeletionChecker::SwDeletionChecker(const SwFrame* pFrame)
+ : mpFrame( pFrame )
+ , mpRegIn( pFrame
+ ? pFrame->IsTextFrame()
+ // sw_redlinehide: GetDep() may be a member of SwTextFrame!
+ ? static_cast<SwTextFrame const*>(pFrame)->GetTextNodeFirst()
+ : const_cast<SwFrame*>(pFrame)->GetDep()
+ : nullptr )
+{
+}
+
/// Can be used to check if a frame has been deleted
bool SwDeletionChecker::HasBeenDeleted()
{
commit 408719334fc54e9cb2cbe791cc9a82e55430b7a9
Author: Michael Stahl <Michael.Stahl at cib.de>
Date: Fri Jun 1 20:40:15 2018 +0200
sw_redlinehide: SwXFlatParagraphIterator::getNextPara() iterate ...
... the MergedPara here.
Change-Id: I1a76c9d4a13277987218426a787b5b1b421d36ea
diff --git a/sw/source/core/unocore/unoflatpara.cxx b/sw/source/core/unocore/unoflatpara.cxx
index 425e894e60ac..a39cf00dee4c 100644
--- a/sw/source/core/unocore/unoflatpara.cxx
+++ b/sw/source/core/unocore/unoflatpara.cxx
@@ -39,6 +39,7 @@
#include <unotextrange.hxx>
#include <pagefrm.hxx>
#include <cntfrm.hxx>
+#include <txtfrm.hxx>
#include <rootfrm.hxx>
#include <poolfmt.hxx>
#include <pagedesc.hxx>
@@ -396,16 +397,46 @@ uno::Reference< text::XFlatParagraph > SwXFlatParagraphIterator::getNextPara()
while( pCnt && pCurrentPage->IsAnLower( pCnt ) )
{
- SwTextNode* pTextNode = pCnt->GetNode()->GetTextNode();
-
- if ( pTextNode &&
- ((mnType == text::TextMarkupType::SPELLCHECK &&
- pTextNode->IsWrongDirty()) ||
- (mnType == text::TextMarkupType::PROOFREADING &&
- pTextNode->IsGrammarCheckDirty())) )
+ if (pCnt->IsTextFrame())
{
- pRet = pTextNode;
- break;
+ SwTextFrame const*const pText(static_cast<SwTextFrame const*>(pCnt));
+ if (sw::MergedPara const*const pMergedPara = pText->GetMergedPara()
+ )
+ {
+ SwTextNode * pTextNode(nullptr);
+ for (auto const& e : pMergedPara->extents)
+ {
+ if (e.pNode != pTextNode)
+ {
+ pTextNode = e.pNode;
+ if ((mnType == text::TextMarkupType::SPELLCHECK
+ && pTextNode->IsWrongDirty()) ||
+ (mnType == text::TextMarkupType::PROOFREADING
+ && pTextNode->IsGrammarCheckDirty()))
+ {
+ pRet = pTextNode;
+ break;
+ }
+ }
+ }
+ }
+ else
+ {
+ SwTextNode const*const pTextNode(pText->GetTextNodeFirst());
+ if ((mnType == text::TextMarkupType::SPELLCHECK
+ && pTextNode->IsWrongDirty()) ||
+ (mnType == text::TextMarkupType::PROOFREADING
+ && pTextNode->IsGrammarCheckDirty()))
+
+ {
+ pRet = const_cast<SwTextNode*>(pTextNode);
+ }
+ }
+
+ if (pRet)
+ {
+ break;
+ }
}
pCnt = pCnt->GetNextContentFrame();
commit 348d6eae6008b4d3aa5c087a75e75becc13dafb8
Author: Michael Stahl <Michael.Stahl at cib.de>
Date: Fri Jun 1 20:38:13 2018 +0200
sw_redlinehide: trivial GetNode() in PageBreakWin.cxx
Change-Id: I7bdf58d1f2233ab77a1b774a99aa068fe9438ae8
diff --git a/sw/source/uibase/docvw/PageBreakWin.cxx b/sw/source/uibase/docvw/PageBreakWin.cxx
index 1580fc4eb756..366c204f9dc8 100644
--- a/sw/source/uibase/docvw/PageBreakWin.cxx
+++ b/sw/source/uibase/docvw/PageBreakWin.cxx
@@ -12,6 +12,8 @@
#include <cmdid.h>
#include <cntfrm.hxx>
+#include <txtfrm.hxx>
+#include <notxtfrm.hxx>
#include <DashedLine.hxx>
#include <doc.hxx>
#include <edtwin.hxx>
@@ -240,7 +242,9 @@ void SwPageBreakWin::Select()
rSh.ClearMark();
SwContentFrame *pCnt = const_cast< SwContentFrame* >( pBodyFrame->ContainsContent() );
- SwContentNode* pNd = pCnt->GetNode();
+ SwContentNode* pNd = pCnt->IsTextFrame()
+ ? static_cast<SwTextFrame*>(pCnt)->GetTextNodeFirst()
+ : static_cast<SwNoTextFrame*>(pCnt)->GetNode();
rSh.SetSelection( *pNd );
SfxStringItem aItem(pEditWin->GetView().GetPool().GetWhich(FN_FORMAT_TABLE_DLG), "textflow");
@@ -254,7 +258,9 @@ void SwPageBreakWin::Select()
else
{
SwContentFrame *pCnt = const_cast< SwContentFrame* >( pBodyFrame->ContainsContent() );
- SwContentNode* pNd = pCnt->GetNode();
+ SwContentNode* pNd = pCnt->IsTextFrame()
+ ? static_cast<SwTextFrame*>(pCnt)->GetTextNodeFirst()
+ : static_cast<SwNoTextFrame*>(pCnt)->GetNode();
SwPaM aPaM( *pNd );
SwPaMItem aPaMItem( pEditWin->GetView().GetPool( ).GetWhich( FN_PARAM_PAM ), &aPaM );
@@ -276,8 +282,11 @@ void SwPageBreakWin::Select()
if ( pBodyFrame )
{
+
SwContentFrame *pCnt = const_cast< SwContentFrame* >( pBodyFrame->ContainsContent() );
- SwContentNode* pNd = pCnt->GetNode();
+ SwContentNode* pNd = pCnt->IsTextFrame()
+ ? static_cast<SwTextFrame*>(pCnt)->GetTextNodeFirst()
+ : static_cast<SwNoTextFrame*>(pCnt)->GetNode();
pNd->GetDoc()->GetIDocumentUndoRedo( ).StartUndo( SwUndoId::UI_DELETE_PAGE_BREAK, nullptr );
commit 6a71c9b58f2a66329f9f68ca1beb8db98cf7cc6c
Author: Michael Stahl <Michael.Stahl at cib.de>
Date: Fri Jun 1 20:34:02 2018 +0200
sw_redlinehide: trivial GetNode() in text
Change-Id: Ied6e80e30ced49b11952c44c36e86e8575e42c0f
diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx
index c7c53d83e4f9..c57764acb569 100644
--- a/sw/source/core/text/frmcrsr.cxx
+++ b/sw/source/core/text/frmcrsr.cxx
@@ -1368,7 +1368,7 @@ void SwTextFrame::FillCursorPos( SwFillData& rFill ) const
aSet.Put( *GetTextNodeForParaProps()->GetpSwAttrSet() );
aSet.SetParent( pSet );
pSet = &aSet;
- pFnt = new SwFont( pSet, GetNode()->getIDocumentSettingAccess() );
+ pFnt = new SwFont( pSet, &GetDoc().getIDocumentSettingAccess() );
}
else
{
diff --git a/sw/source/core/text/guess.cxx b/sw/source/core/text/guess.cxx
index 9bcb7bd33fe3..14b1de671f54 100644
--- a/sw/source/core/text/guess.cxx
+++ b/sw/source/core/text/guess.cxx
@@ -80,7 +80,8 @@ bool SwTextGuess::Guess( const SwTextPortion& rPor, SwTextFormatInfo &rInf,
// for LTR mode only
if ( !rInf.GetTextFrame()->IsRightToLeft() )
{
- if ( rInf.GetTextFrame()->GetNode()->getIDocumentSettingAccess()->get( DocumentSettingId::MS_WORD_COMP_TRAILING_BLANKS ) )
+ if (rInf.GetTextFrame()->GetDoc().getIDocumentSettingAccess().get(
+ DocumentSettingId::MS_WORD_COMP_TRAILING_BLANKS))
{
if ( rAdjust == SvxAdjust::Right || rAdjust == SvxAdjust::Center )
{
@@ -380,7 +381,7 @@ bool SwTextGuess::Guess( const SwTextPortion& rPor, SwTextFormatInfo &rInf,
}
const ForbiddenCharacters aForbidden(
- *rInf.GetTextFrame()->GetNode()->getIDocumentSettingAccess()->getForbiddenCharacters( aLang, true ) );
+ *rInf.GetTextFrame()->GetDoc().getIDocumentSettingAccess().getForbiddenCharacters(aLang, true));
const bool bAllowHanging = rInf.IsHanging() && ! rInf.IsMulti() &&
! rInf.GetTextFrame()->IsInTab() &&
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 4a0aef64c070..a0e7c1c06131 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -1168,7 +1168,7 @@ void SwTextPaintInfo::DrawBackBrush( const SwLinePortion &rPor ) const
// for LTR mode only
if ( !GetTextFrame()->IsRightToLeft() )
{
- if ( GetTextFrame()->GetNode()->getIDocumentSettingAccess()->get( DocumentSettingId::MS_WORD_COMP_TRAILING_BLANKS ) )
+ if (GetTextFrame()->GetDoc().getIDocumentSettingAccess().get(DocumentSettingId::MS_WORD_COMP_TRAILING_BLANKS))
{
bool draw = false;
bool full = false;
diff --git a/sw/source/core/text/itradj.cxx b/sw/source/core/text/itradj.cxx
index 428c8d93fe51..76e115318422 100644
--- a/sw/source/core/text/itradj.cxx
+++ b/sw/source/core/text/itradj.cxx
@@ -19,6 +19,7 @@
#include <vcl/outdev.hxx>
#include <IDocumentSettingAccess.hxx>
+#include <doc.hxx>
#include <frame.hxx>
#include <paratr.hxx>
@@ -281,7 +282,7 @@ void SwTextAdjuster::CalcNewBlock( SwLineLayout *pCurrent,
// #i49277#
const bool bDoNotJustifyLinesWithManualBreak =
- GetTextFrame()->GetNode()->getIDocumentSettingAccess()->get(DocumentSettingId::DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK);
+ GetTextFrame()->GetDoc().getIDocumentSettingAccess().get(DocumentSettingId::DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK);
SwLinePortion *pPos = pCurrent->GetPortion();
@@ -588,7 +589,7 @@ void SwTextAdjuster::CalcFlyAdjust( SwLineLayout *pCurrent )
// If we only have one line, the text portion is consecutive and we center, then ...
bool bComplete = TextFrameIndex(0) == m_nStart;
- const bool bTabCompat = GetTextFrame()->GetNode()->getIDocumentSettingAccess()->get(DocumentSettingId::TAB_COMPAT);
+ const bool bTabCompat = GetTextFrame()->GetDoc().getIDocumentSettingAccess().get(DocumentSettingId::TAB_COMPAT);
bool bMultiTab = false;
while( pPos )
diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index b89ade928e9e..4103b8505b77 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -1769,10 +1769,7 @@ bool SwTextFrame::FillSelection( SwSelectionList& rSelList, const SwRect& rRect
{
SwRect aRect( aTmpFrame );
aRect.Intersection( rRect );
- // rNode without const to create SwPaMs
- SwContentNode &rNode = const_cast<SwContentNode&>( *GetNode() );
- SwNodeIndex aIdx( rNode );
- SwPosition aPosL( aIdx, SwIndex( &rNode, 0 ) );
+ SwPosition aPosL( MapViewToModelPos(TextFrameIndex(0)) );
if( IsEmpty() )
{
SwPaM *pPam = new SwPaM( aPosL, aPosL );
@@ -1780,7 +1777,7 @@ bool SwTextFrame::FillSelection( SwSelectionList& rSelList, const SwRect& rRect
}
else if( aRect.HasArea() )
{
- sal_Int32 nOld = -1;
+ SwPosition aOld(aPosL.nNode.GetNodes().GetEndOfContent());
SwPosition aPosR( aPosL );
Point aPoint;
SwTextInfo aInf( const_cast<SwTextFrame*>(this) );
@@ -1844,11 +1841,11 @@ bool SwTextFrame::FillSelection( SwSelectionList& rSelList, const SwRect& rRect
// which could happen e.g. for field portions or fly frames
// a SwPaM will be inserted with these positions
if( GetCursorOfst( &aPosR, aPoint, &aState ) &&
- nOld != aPosL.nContent.GetIndex() )
+ aOld != aPosL)
{
SwPaM *pPam = new SwPaM( aPosL, aPosR );
rSelList.insertPaM( pPam );
- nOld = aPosL.nContent.GetIndex();
+ aOld = aPosL;
}
}
}
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index 4080c85ce0ae..10aa3be6ff72 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -382,8 +382,8 @@ void SwTextFormatter::BuildPortions( SwTextFormatInfo &rInf )
GRID_LINES_CHARS == pGrid->GetGridType();
- const SwDoc *pDoc = rInf.GetTextFrame()->GetNode()->GetDoc();
- const sal_uInt16 nGridWidth = bHasGrid ? GetGridWidth(*pGrid, *pDoc) : 0;
+ const SwDoc & rDoc = rInf.GetTextFrame()->GetDoc();
+ const sal_uInt16 nGridWidth = bHasGrid ? GetGridWidth(*pGrid, rDoc) : 0;
// used for grid mode only:
// the pointer is stored, because after formatting of non-asian text,
@@ -1392,7 +1392,7 @@ SwLinePortion *SwTextFormatter::NewPortion( SwTextFormatInfo &rInf )
if ( pTextFootnote )
{
SwFormatFootnote& rFootnote = const_cast<SwFormatFootnote&>(pTextFootnote->GetFootnote());
- const SwDoc *pDoc = rInf.GetTextFrame()->GetNode()->GetDoc();
+ const SwDoc *const pDoc = &rInf.GetTextFrame()->GetDoc();
const SwEndNoteInfo* pInfo;
if( rFootnote.IsEndNote() )
pInfo = &pDoc->GetEndNoteInfo();
@@ -2432,8 +2432,8 @@ void SwTextFormatter::CalcFlyWidth( SwTextFormatInfo &rInf )
aRectFnSet.GetPrtLeft(*pBody) :
aRectFnSet.GetPrtLeft(*pPageFrame);
- const SwDoc *pDoc = rInf.GetTextFrame()->GetNode()->GetDoc();
- const sal_uInt16 nGridWidth = GetGridWidth(*pGrid, *pDoc);
+ const SwDoc & rDoc = rInf.GetTextFrame()->GetDoc();
+ const sal_uInt16 nGridWidth = GetGridWidth(*pGrid, rDoc);
SwTwips nStartX = GetLeftMargin();
if ( aRectFnSet.IsVert() )
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 6fac143a200c..0294756b3ee2 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -50,6 +50,7 @@
#include <redline.hxx>
#include <section.hxx>
#include <calbck.hxx>
+#include <doc.hxx>
#include <IDocumentRedlineAccess.hxx>
#include <IDocumentSettingAccess.hxx>
#include <IDocumentContentOperations.hxx>
@@ -322,7 +323,8 @@ void SwLineLayout::CalcLine( SwTextFormatter &rLine, SwTextFormatInfo &rInf )
// #i3952#
const bool bIgnoreBlanksAndTabsForLineHeightCalculation =
- rInf.GetTextFrame()->GetNode()->getIDocumentSettingAccess()->get(DocumentSettingId::IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION);
+ rInf.GetTextFrame()->GetDoc().getIDocumentSettingAccess().get(
+ DocumentSettingId::IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION);
bool bHasBlankPortion = false;
bool bHasOnlyBlankPortions = true;
diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx
index b0e43f9c6298..c7d3f891fa0d 100644
--- a/sw/source/core/text/txtfly.cxx
+++ b/sw/source/core/text/txtfly.cxx
@@ -1376,8 +1376,8 @@ css::text::WrapTextMode SwTextFly::GetSurroundForTextWrap( const SwAnchoredObjec
else
nRight = 0;
}
- const int textMin = GetMaster()->GetNode()
- ->getIDocumentSettingAccess()->get(DocumentSettingId::SURROUND_TEXT_WRAP_SMALL )
+ const int textMin = GetMaster()->GetDoc()
+ .getIDocumentSettingAccess().get(DocumentSettingId::SURROUND_TEXT_WRAP_SMALL )
? TEXT_MIN_SMALL : TEXT_MIN;
// In case there is no space on either side, then css::text::WrapTextMode_PARALLEL
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index 7be6e88dde06..88f47d89fa6f 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -1995,7 +1995,7 @@ void SwTextFrame::SwClientNotify(SwModify const& rModify, SfxHint const& rHint)
} // switch
if( bSetFieldsDirty )
- GetNode()->getIDocumentFieldsAccess().SetFieldsDirty( true, GetNode(), 1 );
+ GetDoc().getIDocumentFieldsAccess().SetFieldsDirty( true, &rNode, 1 );
if ( bRecalcFootnoteFlag )
CalcFootnoteFlag();
@@ -2081,7 +2081,7 @@ void SwTextFrame::PrepWidows( const sal_uInt16 nNeed, bool bNotify )
static bool lcl_ErgoVadis(SwTextFrame* pFrame, TextFrameIndex & rPos, const PrepareHint ePrep)
{
- const SwFootnoteInfo &rFootnoteInfo = pFrame->GetNode()->GetDoc()->GetFootnoteInfo();
+ const SwFootnoteInfo &rFootnoteInfo = pFrame->GetDoc().GetFootnoteInfo();
if( ePrep == PREP_ERGOSUM )
{
if( rFootnoteInfo.aErgoSum.isEmpty() )
@@ -2232,7 +2232,7 @@ bool SwTextFrame::Prepare( const PrepareHint ePrep, const void* pVoid,
{
// We're the last Footnote; we need to update the
// QuoVadis texts now
- const SwFootnoteInfo &rFootnoteInfo = GetNode()->GetDoc()->GetFootnoteInfo();
+ const SwFootnoteInfo &rFootnoteInfo = GetDoc().GetFootnoteInfo();
if( !pPara->UpdateQuoVadis( rFootnoteInfo.aQuoVadis ) )
{
TextFrameIndex nPos = pPara->GetParLen();
@@ -3152,7 +3152,7 @@ void SwTextFrame::ChgThisLines()
{
// not necessary to format here (GerFormatted etc.), because we have to come from there!
sal_uLong nNew = 0;
- const SwLineNumberInfo &rInf = GetNode()->GetDoc()->GetLineNumberInfo();
+ const SwLineNumberInfo &rInf = GetDoc().GetLineNumberInfo();
if ( !GetText().isEmpty() && HasPara() )
{
SwTextSizeInfo aInf( this );
diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx
index bd9cf48c0967..cb0ab2f2fdb4 100644
--- a/sw/source/core/text/txtftn.cxx
+++ b/sw/source/core/text/txtftn.cxx
@@ -123,7 +123,7 @@ bool SwTextFrame::CalcPrepFootnoteAdjust()
OSL_ENSURE( HasFootnote(), "Who´s calling me?" );
SwFootnoteBossFrame *pBoss = FindFootnoteBossFrame( true );
const SwFootnoteFrame *pFootnote = pBoss->FindFirstFootnote( this );
- if( pFootnote && FTNPOS_CHAPTER != GetNode()->GetDoc()->GetFootnoteInfo().ePos &&
+ if (pFootnote && FTNPOS_CHAPTER != GetDoc().GetFootnoteInfo().ePos &&
( !pBoss->GetUpper()->IsSctFrame() ||
!static_cast<SwSectionFrame*>(pBoss->GetUpper())->IsFootnoteAtEnd() ) )
{
@@ -411,8 +411,7 @@ void SwTextFrame::RemoveFootnote(TextFrameIndex const nStart, TextFrameIndex con
bool bRemove = false;
SwFootnoteBossFrame *pFootnoteBoss = nullptr;
SwFootnoteBossFrame *pEndBoss = nullptr;
- bool bFootnoteEndDoc
- = FTNPOS_CHAPTER == GetNode()->GetDoc()->GetFootnoteInfo().ePos;
+ bool bFootnoteEndDoc = FTNPOS_CHAPTER == GetDoc().GetFootnoteInfo().ePos;
SwTextNode const* pNode(nullptr);
sw::MergedAttrIterReverse iter(*this);
for (SwTextAttr const* pHt = iter.PrevAttr(&pNode); pHt; pHt = iter.PrevAttr(&pNode))
@@ -512,7 +511,7 @@ void SwTextFrame::RemoveFootnote(TextFrameIndex const nStart, TextFrameIndex con
else
{
if (!bEndDoc || ( bEndn && pEndBoss->IsInSct() &&
- !SwLayouter::Collecting( GetNode()->GetDoc(),
+ !SwLayouter::Collecting( &GetDoc(),
pEndBoss->FindSctFrame(), nullptr ) ))
{
if( bEndn )
@@ -602,7 +601,7 @@ void SwTextFrame::ConnectFootnote( SwTextFootnote *pFootnote, const SwTwips nDea
pSect = pBoss->FindSctFrame();
bool bDocEnd = bEnd ? !( pSect && pSect->IsEndnAtEnd() ) :
( !( pSect && pSect->IsFootnoteAtEnd() ) &&
- FTNPOS_CHAPTER == GetNode()->GetDoc()->GetFootnoteInfo().ePos );
+ FTNPOS_CHAPTER == GetDoc().GetFootnoteInfo().ePos);
// Footnote can be registered with the Follow
SwContentFrame *pSrcFrame = FindFootnoteRef( pFootnote );
@@ -624,7 +623,7 @@ void SwTextFrame::ConnectFootnote( SwTextFootnote *pFootnote, const SwTwips nDea
SwFootnoteFrame *pFootnoteFrame = pSrcFrame ? SwFootnoteBossFrame::FindFootnote( pSrcFrame, pFootnote ) : nullptr;
if( pFootnoteFrame && !pFootnoteFrame->GetUpper() )
pFootnoteFrame = nullptr;
- SwDoc *pDoc = GetNode()->GetDoc();
+ SwDoc *const pDoc = &GetDoc();
if( SwLayouter::Collecting( pDoc, pSect, pFootnoteFrame ) )
{
if( !pSrcFrame )
@@ -632,7 +631,7 @@ void SwTextFrame::ConnectFootnote( SwTextFootnote *pFootnote, const SwTwips nDea
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list