LibreOffice Module sw (master) 1
|
#include <hintids.hxx>
#include <osl/diagnose.h>
#include <tools/datetime.hxx>
#include <vcl/weld.hxx>
#include <unotools/collatorwrapper.hxx>
#include <svl/stritem.hxx>
#include <svl/grabbagitem.hxx>
#include <unotools/syslocale.hxx>
#include <IDocumentStylePoolAccess.hxx>
#include <editeng/pmdlitem.hxx>
#include <editeng/tstpitem.hxx>
#include <editeng/boxitem.hxx>
#include <editeng/sizeitem.hxx>
#include <editeng/brushitem.hxx>
#include <svx/pageitem.hxx>
#include <editeng/lrspitem.hxx>
#include <svl/style.hxx>
#include <unotools/localedatawrapper.hxx>
#include <com/sun/star/awt/XPopupMenu.hpp>
#include <com/sun/star/frame/XDispatch.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/util/URLTransformer.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <comphelper/processfactory.hxx>
#include <sfx2/viewfrm.hxx>
#include <sfx2/docfile.hxx>
#include <sfx2/docfilt.hxx>
#include <fmtornt.hxx>
#include <tabcol.hxx>
#include <fmtfsize.hxx>
#include <fmthdft.hxx>
#include <fmtpdsc.hxx>
#include <uiitems.hxx>
#include <docsh.hxx>
#include <wrtsh.hxx>
#include <swmodule.hxx>
#include <view.hxx>
#include <uitool.hxx>
#include <frmatr.hxx>
#include <paratr.hxx>
#include <fmtcol.hxx>
#include <usrpref.hxx>
#include <cmdid.h>
#include <doc.hxx>
#include <charfmt.hxx>
#include <SwStyleNameMapper.hxx>
#include <strings.hrc>
#include <docmodel/color/ComplexColor.hxx>
Go to the source code of this file.
Macros | |
#define | MAXHEIGHT 28350 |
#define | MAXWIDTH 28350 |
Functions | |
void | PrepareBoxInfo (SfxItemSet &rSet, const SwWrtShell &rSh) |
void | ConvertAttrCharToGen (SfxItemSet &rSet, bool bIsPara) |
Convert character specific attributes to general ones used by tab pages. More... | |
void | ConvertAttrGenToChar (SfxItemSet &rSet, const SfxItemSet &rOrigSet, bool bIsPara) |
Convert general attributes to the corresponding character attributes. More... | |
void | ApplyCharBackground (Color const &rBackgroundColor, model::ComplexColor const &rComplexColor, SwWrtShell &rShell) |
Apply character background on the shell. More... | |
static void | FillHdFt (SwFrameFormat *pFormat, const SfxItemSet &rSet) |
static SvxPageUsage | lcl_convertUseToSvx (UseOnPage nUse) |
Convert from UseOnPage to SvxPageUsage. More... | |
static UseOnPage | lcl_convertUseFromSvx (SvxPageUsage nUse) |
Convert from SvxPageUsage to UseOnPage. More... | |
void | ItemSetToPageDesc (const SfxItemSet &rSet, SwPageDesc &rPageDesc) |
void | PageDescToItemSet (const SwPageDesc &rPageDesc, SfxItemSet &rSet) |
void | MakeDefTabs (SwTwips nDefDist, SvxTabStopItem &rTabs) |
SwTwips | GetTabDist (const SvxTabStopItem &rTabs) |
void | SfxToSwPageDescAttr (const SwWrtShell &rShell, SfxItemSet &rSet) |
void | SwToSfxPageDescAttr (SfxItemSet &rCoreSet) |
FieldUnit | GetDfltMetric (bool bWeb) |
void | SetDfltMetric (FieldUnit eMetric, bool bWeb) |
void | InsertStringSorted (const OUString &rId, const OUString &rEntry, weld::ComboBox &rToFill, int nOffset) |
void | FillCharStyleListBox (weld::ComboBox &rToFill, SwDocShell *pDocSh, bool bSorted, bool bWithDefault) |
SwTwips | GetTableWidth (SwFrameFormat const *pFormat, SwTabCols const &rCols, sal_uInt16 *pPercent, SwWrtShell *pSh) |
OUString | GetAppLangDateTimeString (const DateTime &rDT) |
bool | HasCharUnit (bool bWeb) |
void | SetApplyCharUnit (bool bApplyChar, bool bWeb) |
bool | ExecuteMenuCommand (const css::uno::Reference< css::awt::XPopupMenu > &rMenu, const SfxViewFrame &rViewFrame, sal_uInt16 nId) |
#define MAXHEIGHT 28350 |
Definition at line 73 of file uitool.cxx.
#define MAXWIDTH 28350 |
Definition at line 74 of file uitool.cxx.
void ApplyCharBackground | ( | Color const & | rBackgroundColor, |
model::ComplexColor const & | rComplexColor, | ||
SwWrtShell & | rShell | ||
) |
Apply character background on the shell.
Need to use this to hide the mixed character background and character highlighting attribute, which were added for MSO compatibility where there are two kind of character background.
[in] | rBackgroundColor | the color to apply on the shell |
[in,out] | rShell | the shell on which we apply the new attribute |
Definition at line 197 of file uitool.cxx.
References SwEditShell::EndUndo(), SwEditShell::GetCurAttr(), SfxGrabBagItem::GetGrabBag(), SfxItemSet::GetItemIfSet(), SfxShell::GetPool(), SwWrtShell::GetView(), INSATTR, RES_CHRATR_BACKGROUND(), RES_CHRATR_GRABBAG(), RES_CHRATR_HIGHLIGHT(), SwEditShell::SetAttrItem(), and SwEditShell::StartUndo().
Referenced by SwTextShell::Execute(), and SwEditWin::MouseButtonUp().
void ConvertAttrCharToGen | ( | SfxItemSet & | rSet, |
bool | bPara = false |
||
) |
Convert character specific attributes to general ones used by tab pages.
[in,out] | rSet | the set in which character attributes are stored |
[in] | bIsPara | is called by a paragraph style |
Definition at line 106 of file uitool.cxx.
References COL_TRANSPARENT(), SvxBrushItem::GetColor(), SfxGrabBagItem::GetGrabBag(), SfxItemSet::GetItemIfSet(), SfxItemSet::GetItemState(), SfxItemSet::GetRanges(), i, SfxItemSet::MergeRange(), SfxItemSet::Put(), RES_CHRATR_BACKGROUND(), RES_CHRATR_HIGHLIGHT(), RES_PARATR_GRABBAG(), rSet, and WhichRangesContainer::size().
Referenced by SwEnvFormatPage::Edit(), SwDocShell::Edit(), and sw_CharDialog().
void ConvertAttrGenToChar | ( | SfxItemSet & | rSet, |
const SfxItemSet & | rOrigSet, | ||
bool | bPara = false |
||
) |
Convert general attributes to the corresponding character attributes.
This method is used after executed a character dialog.
[in,out] | rSet | the set in which character attributes are stored |
[in] | rOrigSet | original itemset used as input for the dialog |
[in] | bIsPara | is called by a paragraph style |
Definition at line 145 of file uitool.cxx.
References SfxItemSet::ClearItem(), SfxGrabBagItem::GetGrabBag(), SfxItemSet::GetItemIfSet(), SfxItemSet::GetItemState(), i, SfxItemSet::Put(), RES_BACKGROUND(), RES_CHRATR_BACKGROUND(), RES_CHRATR_GRABBAG(), RES_CHRATR_HIGHLIGHT(), RES_PARATR_GRABBAG(), rSet, and SfxItemSet::SetRanges().
Referenced by SwEnvFormatPage::Edit(), IMPL_LINK_NOARG(), and sw_CharDialogResult().
bool ExecuteMenuCommand | ( | const css::uno::Reference< css::awt::XPopupMenu > & | rMenu, |
const SfxViewFrame & | rViewFrame, | ||
sal_uInt16 | nId | ||
) |
Definition at line 883 of file uitool.cxx.
References aSeq, aURL, SfxViewFrame::GetFrame(), SfxFrame::GetFrameInterface(), nId, and xFrame.
Referenced by SwEditWin::Command(), and SwView::ExecSpellPopup().
void FillCharStyleListBox | ( | weld::ComboBox & | rToFill, |
SwDocShell * | pDocSh, | ||
bool | bSorted, | ||
bool | bWithDefault | ||
) |
Definition at line 781 of file uitool.cxx.
References weld::ComboBox::append(), ChrFmt, weld::ComboBox::find_text(), SfxStyleSheetBasePool::First(), weld::Widget::freeze(), weld::ComboBox::get_count(), SwDoc::GetCharFormats(), SwDocShell::GetDoc(), SfxStyleSheetBase::GetName(), SwFormat::GetName(), SwStyleNameMapper::GetPoolIdFromUIName(), SwDocShell::GetStyleSheetPool(), i, InsertStringSorted(), SwFormat::IsDefault(), SfxStyleSheetBasePool::Next(), sId, SwCharFormats::size(), SwResId(), and weld::Widget::thaw().
Referenced by SwTemplateDlgController::PageCreated(), SwSvxNumBulletTabDialog::PageCreated(), SwDropCapsPage::Reset(), SwEndNoteOptionPage::SetShell(), SwTOXEntryTabPage::SetWrtShell(), SwOutlineSettingsTabPage::SetWrtShell(), SwCaptionOptPage::SwCaptionOptPage(), SwCharURLPage::SwCharURLPage(), and SwLineNumberingDlg::SwLineNumberingDlg().
|
static |
Definition at line 230 of file uitool.cxx.
References Fixed, SfxItemSet::Get(), SwFormat::GetAttrSet(), SvxSizeItem::GetSize(), SfxBoolItem::GetValue(), Size::Height(), Minimum, SfxItemSet::Put(), rSet, SwFormat::SetFormatAttr(), and Size::Width().
Referenced by ItemSetToPageDesc().
OUString GetAppLangDateTimeString | ( | const DateTime & | rDT | ) |
Definition at line 863 of file uitool.cxx.
References LocaleDataWrapper::getDate(), SvtSysLocale::GetLocaleData(), and LocaleDataWrapper::getTime().
Referenced by SwTextShell::ExecField(), IMPL_LINK(), SwRedlineAcceptDlg::InsertChildren(), SwRedlineAcceptDlg::InsertParents(), lcl_GetRedlineHelp(), and sw::sidebarwindows::SidebarTextControl::RequestHelp().
FieldUnit GetDfltMetric | ( | bool | bWeb | ) |
Definition at line 756 of file uitool.cxx.
References SW_MOD.
Referenced by SwLabPage::DisplayFormat(), SwDocShell::Edit(), SwDrawTextShell::ExecFontWork(), SwTextShell::ExecInsert(), SwDrawShell::Execute(), SwDrawTextShell::Execute(), SwFrameShell::Execute(), SwTableShell::Execute(), SwTextShell::Execute(), SwGrfShell::Execute(), SwDrawBaseShell::Execute(), SwTableColumnPage::Init(), SwEditWin::MouseMove(), SwTemplateDlgController::PageCreated(), SwSvxNumBulletTabDialog::PageCreated(), SwSectionIndentTabPage::Reset(), SwColumnPage::Reset(), SwFramePage::Reset(), SwWrapTabPage::Reset(), SwFormatTablePage::Reset(), SwNumPositionTabPage::SetWrtShell(), SwModule::StateOther(), sw_CharDialog(), SwDropCapsPage::SwDropCapsPage(), SwEnvFormatPage::SwEnvFormatPage(), SwEnvPrtPage::SwEnvPrtPage(), SwLabFormatPage::SwLabFormatPage(), SwMailMergeLayoutPage::SwMailMergeLayoutPage(), SwTOXEntryTabPage::SwTOXEntryTabPage(), and sw::sidebar::WrapPropertyPanel::WrapPropertyPanel().
SwTwips GetTabDist | ( | const SvxTabStopItem & | rTabs | ) |
Definition at line 650 of file uitool.cxx.
References SvxTabStopItem::Count().
Referenced by SwModule::CreateItemSet(), SwEnvFormatPage::Edit(), SwView::ExecTabWin(), SwTextShell::Execute(), SwView::GetState(), and SwView::StateTabWin().
SwTwips GetTableWidth | ( | SwFrameFormat const * | pFormat, |
SwTabCols const & | rCols, | ||
sal_uInt16 * | pPercent, | ||
SwWrtShell * | pSh | ||
) |
Definition at line 822 of file uitool.cxx.
References FlyEmbeddedPrt, SwFEShell::GetAnyCurRect(), SwFEShell::GetFlyFrameFormat(), SwFormat::GetFrameSize(), SwFormatHoriOrient::GetHoriOrient(), SwFormat::GetHoriOrient(), SvxLRSpaceItem::GetLeft(), SwFormat::GetLRSpace(), SvxLRSpaceItem::GetRight(), SwTabCols::GetRight(), SvxSizeItem::GetWidth(), SwFormatFrameSize::GetWidthPercent(), PagePrt, and SwRect::Width().
Referenced by lcl_TableParamToItemSet().
bool HasCharUnit | ( | bool | bWeb | ) |
void InsertStringSorted | ( | const OUString & | rId, |
const OUString & | rEntry, | ||
weld::ComboBox & | rToFill, | ||
int | nOffset | ||
) |
Definition at line 768 of file uitool.cxx.
References CollatorWrapper::compareString(), weld::ComboBox::get_count(), weld::ComboBox::get_text(), GetAppCaseCollator(), weld::ComboBox::insert(), and nCount.
Referenced by FillCharStyleListBox(), lcl_InsertVectors(), and SwBreakDlg::SwBreakDlg().
void ItemSetToPageDesc | ( | const SfxItemSet & | rSet, |
SwPageDesc & | rPageDesc | ||
) |
Definition at line 278 of file uitool.cxx.
References SwPageDesc::ChgFirstShare(), SwPageDesc::ChgFooterShare(), SwPageDesc::ChgHeaderShare(), FillHdFt(), SwDoc::FindTextFormatCollByName(), Fixed, FN_PARAM_FTN_INFO, SfxItemSet::Get(), SwDoc::GetDfltTextFormatColl(), SwFormat::GetDoc(), SwFormat::GetFooter(), SwFormatFooter::GetFooterFormat(), SwFormat::GetHeader(), SwFormatHeader::GetHeaderFormat(), SwDoc::getIDocumentStylePoolAccess(), SfxItemSet::GetItemIfSet(), SfxItemSet::GetItemState(), SwPageDesc::GetMaster(), SvxPageItem::GetNumType(), SvxPageItem::GetPageUsage(), SwStyleNameMapper::GetPoolIdFromUIName(), SvxSizeItem::GetSize(), IDocumentStylePoolAccess::GetTextCollFromPool(), SfxBoolItem::GetValue(), SwFormatHeader::IsActive(), SwFormatFooter::IsActive(), SvxPageItem::IsLandscape(), lcl_convertUseFromSvx(), SwDoc::MakeTextFormatColl(), nId, RES_BACKGROUND_FULL_SIZE(), RES_RTL_GUTTER(), rSet, SwPageDesc::SetFootnoteInfo(), SwFormat::SetFormatAttr(), SwTextFormatColl::SetFormatAttr(), SwPageDesc::SetLandscape(), SvxNumberType::SetNumberingType(), SwPageDesc::SetNumType(), SwPageDesc::SetRegisterFormatColl(), SvxSizeItem::SetSize(), SwPageDesc::SetUseOn(), and TxtColl.
Referenced by SwView::Execute(), and SwDocStyleSheet::SetItemSet().
|
static |
Convert from SvxPageUsage to UseOnPage.
Definition at line 262 of file uitool.cxx.
References All, Left, Mirror, NONE, and Right.
Referenced by ItemSetToPageDesc().
|
static |
Convert from UseOnPage to SvxPageUsage.
Definition at line 247 of file uitool.cxx.
References All, Left, Mirror, and Right.
Referenced by PageDescToItemSet().
void MakeDefTabs | ( | SwTwips | nDefDist, |
SvxTabStopItem & | rTabs | ||
) |
Definition at line 638 of file uitool.cxx.
References SvxTabStopItem::Count(), and SvxTabStopItem::Insert().
Referenced by SwModule::ApplyItemSet(), SwEnvFormatPage::Edit(), SwView::ExecTabWin(), SwView::Execute(), and SwTextShell::Execute().
void PageDescToItemSet | ( | const SwPageDesc & | rPageDesc, |
SfxItemSet & | rSet | ||
) |
Definition at line 458 of file uitool.cxx.
References Fixed, SwFormat::GetAttrSet(), SwDoc::GetDfltFrameFormat(), SwFormat::GetDoc(), SwPageDesc::GetFollow(), SwFormat::GetFooter(), SwFormatFooter::GetFooterFormat(), SwPageDesc::GetFootnoteInfo(), SwFormat::GetFrameSize(), SwFormat::GetHeader(), SwFormatHeader::GetHeaderFormat(), SwFormatFrameSize::GetHeightSizeType(), SfxItemSet::GetItem(), SfxItemSet::GetItemIfSet(), SwPageDesc::GetLandscape(), SwPageDesc::GetMaster(), SwFormat::GetName(), SwPageDesc::GetName(), SvxNumberType::GetNumberingType(), SwPageDesc::GetNumType(), SfxItemSet::GetPool(), SwPageDesc::GetRegisterFormatColl(), SvxSizeItem::GetSize(), SwPageDesc::GetUseOn(), GetValue, SwFormatHeader::IsActive(), SwFormatFooter::IsActive(), SwPageDesc::IsFirstShared(), SwPageDesc::IsFooterShared(), SwPageDesc::IsHeaderShared(), lcl_convertUseToSvx(), MAXHEIGHT, MAXWIDTH, MIN_BORDER_DIST, SfxItemSet::Put(), RES_BACKGROUND_FULL_SIZE(), RES_FRMATR_BEGIN(), RES_FRMATR_END(), RES_RTL_GUTTER(), rSet, SvxPageItem::SetDescName(), SvxPageItem::SetLandscape(), SvxPageItem::SetNumType(), SvxPageItem::SetPageUsage(), CntUnencodedStringItem::SetValue(), SfxPoolItem::SetWhich(), XATTR_FILL_FIRST(), and XATTR_FILL_LAST().
Referenced by SwDocStyleSheet::GetItemSet(), and SwView::GetState().
void PrepareBoxInfo | ( | SfxItemSet & | rSet, |
const SwWrtShell & | rSh | ||
) |
Definition at line 82 of file uitool.cxx.
References SwCursorShell::GetCursor(), SwCursorShell::GetCursorCnt(), SfxItemSet::GetItemIfSet(), SwWrtShell::GetSelectionType(), SwCursorShell::IsTableMode(), MIN_BORDER_DIST, SfxItemSet::Put(), rSet, Table, and Text.
Referenced by SwEnvFormatPage::Edit(), SwBaseShell::ExecDlg(), SwTextShell::Execute(), SwBaseShell::GetBorderState(), sw_CharDialog(), SwFlyFrameAttrMgr::SwFlyFrameAttrMgr(), and SwFlyFrameAttrMgr::UpdateAttrMgr().
void SetApplyCharUnit | ( | bool | bApplyChar, |
bool | bWeb | ||
) |
Definition at line 878 of file uitool.cxx.
References SW_MOD.
Referenced by SwModule::ApplyItemSet().
void SetDfltMetric | ( | FieldUnit | eMetric, |
bool | bWeb | ||
) |
Definition at line 763 of file uitool.cxx.
References SW_MOD.
Referenced by SwModule::ApplyItemSet(), and SwModule::ExecOther().
void SfxToSwPageDescAttr | ( | const SwWrtShell & | rShell, |
SfxItemSet & | rSet | ||
) |
Definition at line 656 of file uitool.cxx.
References SfxItemSet::ClearItem(), SwEditShell::GetCurAttr(), SfxItemSet::GetItemIfSet(), SfxItemSet::GetItemState(), SfxShell::GetPool(), GetValue, SwWrtShell::GetView(), SfxItemSet::Put(), SwFormatPageDesc::RegisterToPageDesc(), RES_BREAK(), RES_PAGEDESC(), rSet, and SwFormatPageDesc::SetNumOffset().
Referenced by SwTextShell::ExecParaAttrArgs(), SwView::FUNC_Search(), IMPL_LINK_NOARG(), SwView::Replace(), and sw_ParagraphDialogResult().
void SwToSfxPageDescAttr | ( | SfxItemSet & | rCoreSet | ) |
Definition at line 717 of file uitool.cxx.
References aName, SfxItemSet::ClearItem(), SfxItemSet::GetItemState(), SwPageDesc::GetName(), SwFormatPageDesc::GetNumOffset(), SwFormatPageDesc::GetPageDesc(), SfxItemSet::Put(), and RES_PAGEDESC().
Referenced by SwDocShell::Edit(), SwTextShell::Execute(), and SwTextShell::GetAttrState().