/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
/* IDocumentSettingAccess */ bool sw::DocumentSettingManager::get(/*[in]*/ DocumentSettingId id) const
{ switch (id)
{ // COMPATIBILITY FLAGS START case DocumentSettingId::PARA_SPACE_MAX: return mbParaSpaceMax; //(n8Dummy1 & DUMMY_PARASPACEMAX); case DocumentSettingId::PARA_SPACE_MAX_AT_PAGES: return mbParaSpaceMaxAtPages; //(n8Dummy1 & DUMMY_PARASPACEMAX_AT_PAGES); case DocumentSettingId::TAB_COMPAT: return mbTabCompat; //(n8Dummy1 & DUMMY_TAB_COMPAT); case DocumentSettingId::ADD_FLY_OFFSETS: return mbAddFlyOffsets; //(n8Dummy2 & DUMMY_ADD_FLY_OFFSETS); case DocumentSettingId::ADD_VERTICAL_FLY_OFFSETS: return mbAddVerticalFlyOffsets; case DocumentSettingId::ADD_EXT_LEADING: return mbAddExternalLeading; //(n8Dummy2 & DUMMY_ADD_EXTERNAL_LEADING); case DocumentSettingId::USE_VIRTUAL_DEVICE: return mbUseVirtualDevice; //(n8Dummy1 & DUMMY_USE_VIRTUAL_DEVICE); case DocumentSettingId::USE_HIRES_VIRTUAL_DEVICE: return mbUseHiResolutionVirtualDevice; //(n8Dummy2 & DUMMY_USE_HIRES_VIR_DEV); case DocumentSettingId::OLD_NUMBERING: return mbOldNumbering; case DocumentSettingId::OLD_LINE_SPACING: return mbOldLineSpacing; case DocumentSettingId::ADD_PARA_SPACING_TO_TABLE_CELLS: return mbAddParaSpacingToTableCells; case DocumentSettingId::ADD_PARA_LINE_SPACING_TO_TABLE_CELLS: return mbAddParaLineSpacingToTableCells; case DocumentSettingId::USE_FORMER_OBJECT_POS: return mbUseFormerObjectPos; case DocumentSettingId::USE_FORMER_TEXT_WRAPPING: return mbUseFormerTextWrapping; case DocumentSettingId::CONSIDER_WRAP_ON_OBJECT_POSITION: return mbConsiderWrapOnObjPos; case DocumentSettingId::DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK: return mbDoNotJustifyLinesWithManualBreak; case DocumentSettingId::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING: return mbIgnoreFirstLineIndentInNumbering; case DocumentSettingId::NO_GAP_AFTER_NOTE_NUMBER: return mbNoGapAfterNoteNumber; case DocumentSettingId::TABLE_ROW_KEEP: return mbTableRowKeep; case DocumentSettingId::IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION: return mbIgnoreTabsAndBlanksForLineCalculation; case DocumentSettingId::IGNORE_HIDDEN_CHARS_FOR_LINE_CALCULATION: return mbIgnoreHiddenCharsForLineCalculation; case DocumentSettingId::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE: return mbDoNotCaptureDrawObjsOnPage; // #i68949# case DocumentSettingId::CLIP_AS_CHARACTER_ANCHORED_WRITER_FLY_FRAME: return mbClipAsCharacterAnchoredWriterFlyFrames; case DocumentSettingId::UNIX_FORCE_ZERO_EXT_LEADING: return mbUnixForceZeroExtLeading; case DocumentSettingId::TABS_RELATIVE_TO_INDENT : return mbTabRelativeToIndent; case DocumentSettingId::PROTECT_FORM: return mbProtectForm; // tdf#104349 tdf#104668 case DocumentSettingId::MS_WORD_COMP_TRAILING_BLANKS: return mbMsWordCompTrailingBlanks; case DocumentSettingId::MS_WORD_COMP_MIN_LINE_HEIGHT_BY_FLY: return mbMsWordCompMinLineHeightByFly; // #i89181# case DocumentSettingId::TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST: return mbTabAtLeftIndentForParagraphsInList; case DocumentSettingId::INVERT_BORDER_SPACING: return mbInvertBorderSpacing; case DocumentSettingId::COLLAPSE_EMPTY_CELL_PARA: return mbCollapseEmptyCellPara; case DocumentSettingId::SMALL_CAPS_PERCENTAGE_66: return mbSmallCapsPercentage66; case DocumentSettingId::TAB_OVERFLOW: return mbTabOverflow; case DocumentSettingId::UNBREAKABLE_NUMBERINGS: return mbUnbreakableNumberings; case DocumentSettingId::CLIPPED_PICTURES: return mbClippedPictures; case DocumentSettingId::BACKGROUND_PARA_OVER_DRAWINGS: return mbBackgroundParaOverDrawings; case DocumentSettingId::TAB_OVER_MARGIN: return mbTabOverMargin; case DocumentSettingId::TAB_OVER_SPACING: return mbTabOverSpacing; case DocumentSettingId::TREAT_SINGLE_COLUMN_BREAK_AS_PAGE_BREAK: return mbTreatSingleColumnBreakAsPageBreak; case DocumentSettingId::SURROUND_TEXT_WRAP_SMALL: return mbSurroundTextWrapSmall; case DocumentSettingId::PROP_LINE_SPACING_SHRINKS_FIRST_LINE: return mbPropLineSpacingShrinksFirstLine; case DocumentSettingId::SUBTRACT_FLYS: return mbSubtractFlys;
case DocumentSettingId::BROWSE_MODE: return mbLastBrowseMode; // Attention: normally the SwViewShell has to be asked! case DocumentSettingId::HTML_MODE: return mbHTMLMode; case DocumentSettingId::GLOBAL_DOCUMENT: return mbIsGlobalDoc; case DocumentSettingId::GLOBAL_DOCUMENT_SAVE_LINKS: return mbGlblDocSaveLinks; case DocumentSettingId::LABEL_DOCUMENT: return mbIsLabelDoc; case DocumentSettingId::PURGE_OLE: return mbPurgeOLE; case DocumentSettingId::KERN_ASIAN_PUNCTUATION: return mbKernAsianPunctuation; case DocumentSettingId::DO_NOT_RESET_PARA_ATTRS_FOR_NUM_FONT: return mbDoNotResetParaAttrsForNumFont; case DocumentSettingId::MATH_BASELINE_ALIGNMENT: return mbMathBaselineAlignment; case DocumentSettingId::STYLES_NODEFAULT: return mbStylesNoDefault; case DocumentSettingId::EMBED_FONTS: return mEmbedFonts; case DocumentSettingId::EMBED_USED_FONTS: return mEmbedUsedFonts; case DocumentSettingId::EMBED_LATIN_SCRIPT_FONTS: return mEmbedLatinScriptFonts; case DocumentSettingId::EMBED_ASIAN_SCRIPT_FONTS: return mEmbedAsianScriptFonts; case DocumentSettingId::EMBED_COMPLEX_SCRIPT_FONTS: return mEmbedComplexScriptFonts; case DocumentSettingId::EMBED_SYSTEM_FONTS: return mEmbedSystemFonts; case DocumentSettingId::APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING: return mApplyParagraphMarkFormatToNumbering; case DocumentSettingId::DISABLE_OFF_PAGE_POSITIONING: return mbDisableOffPagePositioning; case DocumentSettingId::EMPTY_DB_FIELD_HIDES_PARA: return mbEmptyDbFieldHidesPara; case DocumentSettingId::CONTINUOUS_ENDNOTES: return mbContinuousEndnotes; case DocumentSettingId::PROTECT_BOOKMARKS: return mbProtectBookmarks; case DocumentSettingId::PROTECT_FIELDS: return mbProtectFields; case DocumentSettingId::HEADER_SPACING_BELOW_LAST_PARA: return mbHeaderSpacingBelowLastPara; case DocumentSettingId::FRAME_AUTOWIDTH_WITH_MORE_PARA: return mbFrameAutowidthWithMorePara; case DocumentSettingId::GUTTER_AT_TOP: return mbGutterAtTop; case DocumentSettingId::FOOTNOTE_IN_COLUMN_TO_PAGEEND: return mbFootnoteInColumnToPageEnd; case DocumentSettingId::AUTO_FIRST_LINE_INDENT_DISREGARD_LINE_SPACE: return mbAutoFirstLineIndentDisregardLineSpace; case DocumentSettingId::HYPHENATE_URLS: return mbHyphenateURLs; case DocumentSettingId::APPLY_TEXT_ATTR_TO_EMPTY_LINE_AT_END_OF_PARAGRAPH: return mbApplyTextAttrToEmptyLineAtEndOfParagraph; case DocumentSettingId::APPLY_PARAGRAPH_MARK_FORMAT_TO_EMPTY_LINE_AT_END_OF_PARAGRAPH: return mbApplyParagraphMarkFormatToEmptyLineAtEndOfParagraph; case DocumentSettingId::DO_NOT_BREAK_WRAPPED_TABLES: return mbDoNotBreakWrappedTables; case DocumentSettingId::ALLOW_TEXT_AFTER_FLOATING_TABLE_BREAK: return mbAllowTextAfterFloatingTableBreak; case DocumentSettingId::DO_NOT_MIRROR_RTL_DRAW_OBJS: return mbDoNotMirrorRtlDrawObjs; case DocumentSettingId::JUSTIFY_LINES_WITH_SHRINKING: return mbJustifyLinesWithShrinking; case DocumentSettingId::NO_NUMBERING_SHOW_FOLLOWBY: return mbNoNumberingShowFollowBy; case DocumentSettingId::DROP_CAP_PUNCTUATION: return mbDropCapPunctuation; case DocumentSettingId::USE_VARIABLE_WIDTH_NBSP: return mbUseVariableWidthNBSP; case DocumentSettingId::PAINT_HELL_OVER_HEADER_FOOTER: return mbPaintHellOverHeaderFooter; case DocumentSettingId::MIN_ROW_HEIGHT_INCL_BORDER: return mbMinRowHeightInclBorder; case DocumentSettingId::MS_WORD_COMP_GRID_METRICS: return mbMsWordCompGridMetrics; case DocumentSettingId::NO_CLIPPING_WITH_WRAP_POLYGON: return mbNoClippingWithWrapPolygon; case DocumentSettingId::MS_WORD_UL_TRAIL_SPACE: return mbMsWordUlTrailSpace; case DocumentSettingId::BALANCE_SPACES_AND_IDEOGRAPHIC_SPACES: return mbBalanceSpacesAndIdeographicSpaces; case DocumentSettingId::FORCE_TOP_ALIGNMENT_IN_CELL_WITH_FLOATING_ANCHOR: return mbForceTopAlignmentInCellWithFloatingAnchor; default:
OSL_FAIL("Invalid setting id");
} returnfalse;
}
void sw::DocumentSettingManager::set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value)
{ switch (id)
{ // COMPATIBILITY FLAGS START case DocumentSettingId::PARA_SPACE_MAX:
mbParaSpaceMax = value; break; case DocumentSettingId::PARA_SPACE_MAX_AT_PAGES:
mbParaSpaceMaxAtPages = value; break; case DocumentSettingId::TAB_COMPAT:
mbTabCompat = value; break; case DocumentSettingId::ADD_FLY_OFFSETS:
mbAddFlyOffsets = value; break; case DocumentSettingId::ADD_VERTICAL_FLY_OFFSETS:
mbAddVerticalFlyOffsets = value; break; case DocumentSettingId::ADD_EXT_LEADING:
mbAddExternalLeading = value; break; case DocumentSettingId::USE_VIRTUAL_DEVICE:
mbUseVirtualDevice = value; break; case DocumentSettingId::USE_HIRES_VIRTUAL_DEVICE:
mbUseHiResolutionVirtualDevice = value; break; case DocumentSettingId::OLD_NUMBERING: if (mbOldNumbering != value)
{
mbOldNumbering = value;
const SwNumRuleTable& rNmTable = m_rDoc.GetNumRuleTable(); for( SwNumRuleTable::size_type n = 0; n < rNmTable.size(); ++n )
rNmTable[n]->Invalidate();
m_rDoc.UpdateNumRule();
SwNumRule *pOutlineRule = m_rDoc.GetOutlineNumRule(); if (pOutlineRule)
{
pOutlineRule->Validate(m_rDoc); // counting of phantoms depends on <IsOldNumbering()>
pOutlineRule->SetCountPhantoms( !mbOldNumbering );
}
} break; case DocumentSettingId::OLD_LINE_SPACING:
mbOldLineSpacing = value; break; case DocumentSettingId::ADD_PARA_SPACING_TO_TABLE_CELLS:
mbAddParaSpacingToTableCells = value; break; case DocumentSettingId::ADD_PARA_LINE_SPACING_TO_TABLE_CELLS:
mbAddParaLineSpacingToTableCells = value; break; case DocumentSettingId::USE_FORMER_OBJECT_POS:
mbUseFormerObjectPos = value; break; case DocumentSettingId::USE_FORMER_TEXT_WRAPPING:
mbUseFormerTextWrapping = value; break; case DocumentSettingId::CONSIDER_WRAP_ON_OBJECT_POSITION:
mbConsiderWrapOnObjPos = value; break; case DocumentSettingId::DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK:
mbDoNotJustifyLinesWithManualBreak = value; break; case DocumentSettingId::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING:
mbIgnoreFirstLineIndentInNumbering = value; break; case DocumentSettingId::NO_GAP_AFTER_NOTE_NUMBER:
mbNoGapAfterNoteNumber = value; break;
case DocumentSettingId::TABLE_ROW_KEEP:
mbTableRowKeep = value; break;
case DocumentSettingId::IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION:
mbIgnoreTabsAndBlanksForLineCalculation = value; break;
case DocumentSettingId::IGNORE_HIDDEN_CHARS_FOR_LINE_CALCULATION:
mbIgnoreHiddenCharsForLineCalculation = value; break;
case DocumentSettingId::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE:
mbDoNotCaptureDrawObjsOnPage = value; break;
// #i68949# case DocumentSettingId::CLIP_AS_CHARACTER_ANCHORED_WRITER_FLY_FRAME:
mbClipAsCharacterAnchoredWriterFlyFrames = value; break;
case DocumentSettingId::UNIX_FORCE_ZERO_EXT_LEADING:
mbUnixForceZeroExtLeading = value; break;
case DocumentSettingId::PROTECT_FORM:
mbProtectForm = value; break;
// tdf#140349 case DocumentSettingId::MS_WORD_COMP_TRAILING_BLANKS:
mbMsWordCompTrailingBlanks = value; break;
case DocumentSettingId::MS_WORD_COMP_MIN_LINE_HEIGHT_BY_FLY:
mbMsWordCompMinLineHeightByFly = value; break;
case DocumentSettingId::TABS_RELATIVE_TO_INDENT:
mbTabRelativeToIndent = value; break; // #i89181# case DocumentSettingId::TAB_AT_LEFT_INDENT_FOR_PARA_IN_LIST:
mbTabAtLeftIndentForParagraphsInList = value; break;
case DocumentSettingId::INVERT_BORDER_SPACING:
mbInvertBorderSpacing = value; break;
case DocumentSettingId::COLLAPSE_EMPTY_CELL_PARA:
mbCollapseEmptyCellPara = value; break;
case DocumentSettingId::SMALL_CAPS_PERCENTAGE_66:
mbSmallCapsPercentage66 = value; break;
case DocumentSettingId::TAB_OVERFLOW:
mbTabOverflow = value; break;
case DocumentSettingId::UNBREAKABLE_NUMBERINGS:
mbUnbreakableNumberings = value; break;
case DocumentSettingId::CLIPPED_PICTURES:
mbClippedPictures = value; break;
case DocumentSettingId::BACKGROUND_PARA_OVER_DRAWINGS:
mbBackgroundParaOverDrawings = value; break;
case DocumentSettingId::TAB_OVER_MARGIN:
mbTabOverMargin = value; break;
case DocumentSettingId::TAB_OVER_SPACING:
mbTabOverSpacing = value; break;
case DocumentSettingId::TREAT_SINGLE_COLUMN_BREAK_AS_PAGE_BREAK:
mbTreatSingleColumnBreakAsPageBreak = value; break;
case DocumentSettingId::SURROUND_TEXT_WRAP_SMALL:
mbSurroundTextWrapSmall = value; break;
case DocumentSettingId::PROP_LINE_SPACING_SHRINKS_FIRST_LINE:
mbPropLineSpacingShrinksFirstLine = value; break;
case DocumentSettingId::SUBTRACT_FLYS:
mbSubtractFlys = value; break;
case DocumentSettingId::AUTO_FIRST_LINE_INDENT_DISREGARD_LINE_SPACE:
mbAutoFirstLineIndentDisregardLineSpace = value; break;
case DocumentSettingId::HYPHENATE_URLS:
mbHyphenateURLs = value; break;
case DocumentSettingId::APPLY_TEXT_ATTR_TO_EMPTY_LINE_AT_END_OF_PARAGRAPH:
mbApplyTextAttrToEmptyLineAtEndOfParagraph = value; break;
case DocumentSettingId::APPLY_PARAGRAPH_MARK_FORMAT_TO_EMPTY_LINE_AT_END_OF_PARAGRAPH:
mbApplyParagraphMarkFormatToEmptyLineAtEndOfParagraph = value; break;
case DocumentSettingId::DO_NOT_MIRROR_RTL_DRAW_OBJS:
mbDoNotMirrorRtlDrawObjs = value; break;
case DocumentSettingId::DO_NOT_BREAK_WRAPPED_TABLES:
mbDoNotBreakWrappedTables = value; break;
case DocumentSettingId::ALLOW_TEXT_AFTER_FLOATING_TABLE_BREAK:
mbAllowTextAfterFloatingTableBreak = value; break;
case DocumentSettingId::JUSTIFY_LINES_WITH_SHRINKING:
mbJustifyLinesWithShrinking = value; break;
case DocumentSettingId::NO_NUMBERING_SHOW_FOLLOWBY:
mbNoNumberingShowFollowBy = value; break;
case DocumentSettingId::DROP_CAP_PUNCTUATION:
mbDropCapPunctuation = value; break;
case DocumentSettingId::USE_VARIABLE_WIDTH_NBSP:
mbUseVariableWidthNBSP = value; break;
case DocumentSettingId::PAINT_HELL_OVER_HEADER_FOOTER:
mbPaintHellOverHeaderFooter = value; break;
case DocumentSettingId::MIN_ROW_HEIGHT_INCL_BORDER:
mbMinRowHeightInclBorder = value; break;
// COMPATIBILITY FLAGS END
case DocumentSettingId::BROWSE_MODE: //can be used temporary (load/save) when no SwViewShell is available // Can't render in webview successfully. if (comphelper::LibreOfficeKit::isActive())
mbLastBrowseMode = false; else
mbLastBrowseMode = value; break;
case DocumentSettingId::HTML_MODE:
mbHTMLMode = value; break;
case DocumentSettingId::GLOBAL_DOCUMENT:
mbIsGlobalDoc = value; break;
case DocumentSettingId::GLOBAL_DOCUMENT_SAVE_LINKS:
mbGlblDocSaveLinks = value; break;
case DocumentSettingId::LABEL_DOCUMENT:
mbIsLabelDoc = value; break;
case DocumentSettingId::PURGE_OLE:
mbPurgeOLE = value; break;
case DocumentSettingId::KERN_ASIAN_PUNCTUATION:
mbKernAsianPunctuation = value; break;
case DocumentSettingId::DO_NOT_RESET_PARA_ATTRS_FOR_NUM_FONT:
mbDoNotResetParaAttrsForNumFont = value; break; case DocumentSettingId::MATH_BASELINE_ALIGNMENT:
mbMathBaselineAlignment = value; break; case DocumentSettingId::STYLES_NODEFAULT:
mbStylesNoDefault = value; break; case DocumentSettingId::EMBED_FONTS:
mEmbedFonts = value; break; case DocumentSettingId::EMBED_USED_FONTS:
mEmbedUsedFonts = value; break; case DocumentSettingId::EMBED_LATIN_SCRIPT_FONTS:
mEmbedLatinScriptFonts = value; break; case DocumentSettingId::EMBED_ASIAN_SCRIPT_FONTS:
mEmbedAsianScriptFonts = value; break; case DocumentSettingId::EMBED_COMPLEX_SCRIPT_FONTS:
mEmbedComplexScriptFonts = value; break; case DocumentSettingId::EMBED_SYSTEM_FONTS:
mEmbedSystemFonts = value; break; case DocumentSettingId::APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING:
mApplyParagraphMarkFormatToNumbering = value; break; case DocumentSettingId::DISABLE_OFF_PAGE_POSITIONING:
mbDisableOffPagePositioning = value; break; case DocumentSettingId::EMPTY_DB_FIELD_HIDES_PARA:
mbEmptyDbFieldHidesPara = value; break; case DocumentSettingId::CONTINUOUS_ENDNOTES:
mbContinuousEndnotes = value; break; case DocumentSettingId::PROTECT_BOOKMARKS:
mbProtectBookmarks = value; break; case DocumentSettingId::PROTECT_FIELDS:
mbProtectFields = value; break; case DocumentSettingId::HEADER_SPACING_BELOW_LAST_PARA:
mbHeaderSpacingBelowLastPara = value; break; case DocumentSettingId::FRAME_AUTOWIDTH_WITH_MORE_PARA:
mbFrameAutowidthWithMorePara = value; break; case DocumentSettingId::GUTTER_AT_TOP:
mbGutterAtTop = value; break; case DocumentSettingId::FOOTNOTE_IN_COLUMN_TO_PAGEEND:
mbFootnoteInColumnToPageEnd = value; break; case DocumentSettingId::MS_WORD_COMP_GRID_METRICS:
mbMsWordCompGridMetrics = value; break; case DocumentSettingId::NO_CLIPPING_WITH_WRAP_POLYGON:
mbNoClippingWithWrapPolygon = value; break; case DocumentSettingId::MS_WORD_UL_TRAIL_SPACE:
mbMsWordUlTrailSpace = value; break; case DocumentSettingId::BALANCE_SPACES_AND_IDEOGRAPHIC_SPACES:
mbBalanceSpacesAndIdeographicSpaces = value; break; case DocumentSettingId::FORCE_TOP_ALIGNMENT_IN_CELL_WITH_FLOATING_ANCHOR:
mbForceTopAlignmentInCellWithFloatingAnchor = value; break; default:
OSL_FAIL("Invalid setting id");
}
}
const css::i18n::ForbiddenCharacters*
sw::DocumentSettingManager::getForbiddenCharacters(/*[in]*/ LanguageType nLang, /*[in]*/ bool bLocaleData ) const
{ const css::i18n::ForbiddenCharacters* pRet = nullptr; if (mxForbiddenCharsTable)
pRet = mxForbiddenCharsTable->GetForbiddenCharacters( nLang, false ); if( bLocaleData && !pRet && g_pBreakIt )
pRet = &g_pBreakIt->GetForbidden( nLang ); return pRet;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.