diff options
Diffstat (limited to 'sw/source/core/unocore/unocrsrhelper.cxx')
-rw-r--r-- | sw/source/core/unocore/unocrsrhelper.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index 83646a892b97..d61006f8b008 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -909,7 +909,10 @@ void GetCurPageStyle(SwPaM& rPaM, OUString &rString) { if (!rPaM.GetContentNode()) return; // TODO: is there an easy way to get it for tables/sections? - SwContentFrame* pFrame = rPaM.GetContentNode()->getLayoutFrame(rPaM.GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout()); + SwRootFrame* pLayout = rPaM.GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout(); + // Consider the position inside the content node, since the node may span over multiple pages + // with different page styles. + SwContentFrame* pFrame = rPaM.GetContentNode()->getLayoutFrame(pLayout, /*pDocPos=*/nullptr, rPaM.GetPoint()); if(pFrame) { const SwPageFrame* pPage = pFrame->FindPageFrame(); |