Skip to content
This repository was archived by the owner on Feb 18, 2025. It is now read-only.

Commit 4b182cc

Browse files
authored
[M-1345] - Fix Excessive Tab lengths (#106)
* [M-1345] - Fix Excessive Tab lengths * Fix description
1 parent 4375d81 commit 4b182cc

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

libreoffice-core/sw/source/filter/ww8/docxexport.hxx

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,27 @@ public:
307307
DocxSdrExport& SdrExporter() { return *m_pSdrExport; }
308308

309309
/// Set the document default tab stop.
310-
void setDefaultTabStop( int stop ) { m_aSettings.defaultTabStop = stop; }
310+
void setDefaultTabStop( int stop ) {
311+
// MACRO: M-1345 Fix Indentation Size {
312+
313+
if (m_aSettings.defaultTabStop == 0) {
314+
m_aSettings.defaultTabStop = stop;
315+
} else {
316+
// Temporary solution to prevent massive tab stop lengths
317+
m_aSettings.defaultTabStop = std::min(m_aSettings.defaultTabStop, stop);
318+
}
319+
320+
// Alternative solution to prevent excessive tab stop lengths
321+
/*
322+
if (m_aSettings.defaultTabStop != 0) return;
323+
m_aSettings.defaultTabStop = stop;
324+
*/
325+
326+
// If the tab length is greater then 2 inches, set the tab length to 0.5 inches
327+
if (m_aSettings.defaultTabStop > 3000) { m_aSettings.defaultTabStop = 720; }
328+
329+
// MACRO: }
330+
}
311331

312332
const ::sax_fastparser::FSHelperPtr& GetFS() const { return mpFS; }
313333

0 commit comments

Comments
 (0)