Files
Michael Stahl db115bec92 tdf#78510 sw,cui: split SvxLRSpaceItem for SwTextNode, SwTextFormatColl
Leave editengine and non-paragraph usages of SvxLRSpaceItem as-is for now.

Add new items RES_MARGIN_LEFT etc., order them so that paragraphs can
have 3 consecutive items RES_MARGIN_FIRSTLINE..RES_MARGIN_RIGHT and
non-paragraphs also have 2-4 consecutive items
RES_MARGIN_RIGHT..RES_MARGIN_LEFT (only the 3 paragraph ones are
actually used now).

The HTML import filter is particularly annoying because it parses CSS
stuff into SfxItemSets without knowing where the items will be applied,
so it can't know whether to create SvxLeftMarginItem or
SvxTextLeftMarginItem... the split items are created in ParseCSS1_*
functions and then converted later if necessary.

WW8 import has some weird code as well, SwWW8ImplReader::Read_LR()
creates 3 items and then something wants to set every item on its own
so SwWW8FltControlStack::SetAttrInDoc() turned out rather weird.

Convert the paragraph dialog to handle the split items (by mapping them
to SID_ATTR_PARA_FIRSTLINESPACE/SID_ATTR_PARA_LEFTSPACE/
SID_ATTR_PARA_RIGHTSPACE), but the SvxRuler looks a bit more confusing
so convert in sw shells for now and leave that for later (also unclear if
changing these slot items like SID_ATTR_PARA_LRSPACE breaks any ABIs?).

Change-Id: I40431821868fd3e1cceba121b5539ff9ae6befbc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147024
Tested-by: Michael Stahl <michael.stahl@allotropia.de>
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-02-24 07:32:23 +00:00

126 lines
6.0 KiB
C++

/* -*- 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 .
*/
#ifndef INCLUDED_SW_INC_FRMATR_HXX
#define INCLUDED_SW_INC_FRMATR_HXX
#include "hintids.hxx"
#include "format.hxx"
#include <editeng/pbinitem.hxx>
#include <editeng/lrspitem.hxx>
#include <editeng/ulspitem.hxx>
#include <editeng/prntitem.hxx>
#include <editeng/opaqitem.hxx>
#include <editeng/protitem.hxx>
#include <editeng/boxitem.hxx>
#include <editeng/keepitem.hxx>
#include <editeng/brushitem.hxx>
#include <editeng/shaditem.hxx>
#include <editeng/formatbreakitem.hxx>
#include <editeng/frmdiritem.hxx>
#include <svl/macitem.hxx>
#include <svx/sdtaitm.hxx>
// Inlines
// Implementation of FrameAttribute methods of SwAttrSet.
inline const SvxPaperBinItem &SwAttrSet::GetPaperBin(bool bInP) const
{ return Get( RES_PAPER_BIN,bInP); }
inline const SvxLeftMarginItem& SwAttrSet::GetLeftMargin(bool const bInP) const
{ return Get(RES_MARGIN_LEFT, bInP); }
inline const SvxTextLeftMarginItem& SwAttrSet::GetTextLeftMargin(bool const bInP) const
{ return Get(RES_MARGIN_TEXTLEFT, bInP); }
inline const SvxFirstLineIndentItem& SwAttrSet::GetFirstLineIndent(bool const bInP) const
{ return Get(RES_MARGIN_FIRSTLINE, bInP); }
inline const SvxRightMarginItem& SwAttrSet::GetRightMargin(bool const bInP) const
{ return Get(RES_MARGIN_RIGHT, bInP); }
inline const SvxGutterLeftMarginItem& SwAttrSet::GetGutterLeftMargin(bool const bInP) const
{ return Get(RES_MARGIN_GUTTER, bInP); }
inline const SvxGutterRightMarginItem& SwAttrSet::GetGutterRightMargin(bool const bInP) const
{ return Get(RES_MARGIN_GUTTER_RIGHT, bInP); }
inline const SvxLRSpaceItem &SwAttrSet::GetLRSpace(bool bInP) const
{ return Get( RES_LR_SPACE,bInP); }
inline const SvxULSpaceItem &SwAttrSet::GetULSpace(bool bInP) const
{ return Get( RES_UL_SPACE,bInP); }
inline const SvxPrintItem &SwAttrSet::GetPrint(bool bInP) const
{ return Get( RES_PRINT,bInP); }
inline const SvxOpaqueItem &SwAttrSet::GetOpaque(bool bInP) const
{ return Get( RES_OPAQUE,bInP); }
inline const SvxProtectItem &SwAttrSet::GetProtect(bool bInP) const
{ return Get( RES_PROTECT,bInP); }
inline const SvxBoxItem &SwAttrSet::GetBox(bool bInP) const
{ return Get( RES_BOX,bInP); }
inline const SvxFormatKeepItem &SwAttrSet::GetKeep(bool bInP) const
{ return Get( RES_KEEP,bInP); }
inline const SvxBrushItem &SwAttrSet::GetBackground(bool bInP) const
{ return Get( RES_BACKGROUND,bInP); }
inline const SvxShadowItem &SwAttrSet::GetShadow(bool bInP) const
{ return Get( RES_SHADOW,bInP); }
inline const SvxFormatBreakItem &SwAttrSet::GetBreak(bool bInP) const
{ return Get( RES_BREAK,bInP); }
inline const SvxMacroItem &SwAttrSet::GetMacro(bool bInP) const
{ return Get( RES_FRMMACRO,bInP); }
inline const SvxFrameDirectionItem &SwAttrSet::GetFrameDir(bool bInP) const
{ return Get( RES_FRAMEDIR,bInP); }
inline const SdrTextVertAdjustItem &SwAttrSet::GetTextVertAdjust(bool bInP) const
{ return Get( RES_TEXT_VERT_ADJUST,bInP); }
// Implementation of FrameAttribute methods of SwFormat.
inline const SvxPaperBinItem &SwFormat::GetPaperBin(bool bInP) const
{ return m_aSet.GetPaperBin(bInP); }
inline const SvxLeftMarginItem& SwFormat::GetLeftMargin(bool bInP) const
{ return m_aSet.GetLeftMargin(bInP); }
inline const SvxTextLeftMarginItem& SwFormat::GetTextLeftMargin(bool const bInP) const
{ return m_aSet.GetTextLeftMargin(bInP); }
inline const SvxFirstLineIndentItem& SwFormat::GetFirstLineIndent(bool const bInP) const
{ return m_aSet.GetFirstLineIndent(bInP); }
inline const SvxRightMarginItem& SwFormat::GetRightMargin(bool const bInP) const
{ return m_aSet.GetRightMargin(bInP); }
inline const SvxGutterLeftMarginItem& SwFormat::GetGutterLeftMargin(bool const bInP) const
{ return m_aSet.GetGutterLeftMargin(bInP); }
inline const SvxGutterRightMarginItem& SwFormat::GetGutterRightMargin(bool const bInP) const
{ return m_aSet.GetGutterRightMargin(bInP); }
inline const SvxLRSpaceItem &SwFormat::GetLRSpace(bool bInP) const
{ return m_aSet.GetLRSpace(bInP); }
inline const SvxULSpaceItem &SwFormat::GetULSpace(bool bInP) const
{ return m_aSet.GetULSpace(bInP); }
inline const SvxPrintItem &SwFormat::GetPrint(bool bInP) const
{ return m_aSet.GetPrint(bInP); }
inline const SvxOpaqueItem &SwFormat::GetOpaque(bool bInP) const
{ return m_aSet.GetOpaque(bInP); }
inline const SvxProtectItem &SwFormat::GetProtect(bool bInP) const
{ return m_aSet.GetProtect(bInP); }
inline const SvxBoxItem &SwFormat::GetBox(bool bInP) const
{ return m_aSet.GetBox(bInP); }
inline const SvxFormatKeepItem &SwFormat::GetKeep(bool bInP) const
{ return m_aSet.GetKeep(bInP); }
inline const SvxShadowItem &SwFormat::GetShadow(bool bInP) const
{ return m_aSet.GetShadow(bInP); }
inline const SvxFormatBreakItem &SwFormat::GetBreak(bool bInP) const
{ return m_aSet.GetBreak(bInP); }
inline const SvxMacroItem &SwFormat::GetMacro(bool bInP) const
{ return m_aSet.GetMacro(bInP); }
inline const SvxFrameDirectionItem &SwFormat::GetFrameDir(bool bInP) const
{ return m_aSet.GetFrameDir(bInP); }
inline const SdrTextVertAdjustItem &SwFormat::GetTextVertAdjust(bool bInP) const
{ return m_aSet.GetTextVertAdjust(bInP); }
#endif // INCLUDED_SW_INC_FRMATR_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */