summaryrefslogtreecommitdiff
path: root/sw/source/core/text/inftxt.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/text/inftxt.cxx')
-rw-r--r--sw/source/core/text/inftxt.cxx23
1 files changed, 23 insertions, 0 deletions
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 65e25af2ee58..d66f946a04ed 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -57,6 +57,7 @@
#include "porftn.hxx"
#include "porrst.hxx"
#include "itratr.hxx"
+#include "portab.hxx"
#include <accessibilityoptions.hxx>
#include <wrong.hxx>
#include <doc.hxx>
@@ -1688,6 +1689,28 @@ bool SwTextFormatInfo::LastKernPortion()
return false;
}
+SwTwips SwTextFormatInfo::GetLineWidth()
+{
+ SwTwips nLineWidth = Width() - X();
+
+ const bool bTabOverMargin = GetTextFrame()->GetTextNode()->getIDocumentSettingAccess()->get(
+ DocumentSettingId::TAB_OVER_MARGIN);
+ if (!bTabOverMargin)
+ return nLineWidth;
+
+ SwTabPortion* pLastTab = GetLastTab();
+ if (!pLastTab)
+ return nLineWidth;
+
+ if (pLastTab->GetTabPos() <= Width())
+ return nLineWidth;
+
+ // Consider tab portions over the printing bounds of the text frame.
+ nLineWidth = pLastTab->GetTabPos() - X();
+
+ return nLineWidth;
+}
+
SwTextSlot::SwTextSlot(
const SwTextSizeInfo *pNew,
const SwLinePortion *pPor,