diff options
author | Olivier Hallot <olivier.hallot@edx.srv.br> | 2013-07-11 17:10:14 -0300 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-07-12 08:03:18 +0000 |
commit | 9992b1aadb114159fe5d78e46aebb209d718d958 (patch) | |
tree | baac13fd191a64e26cf6f197ab50c75d201472f7 /sw/source/ui/chrdlg | |
parent | 01ea5d7f6c92055a9a131c124f899968bb7c4023 (diff) |
Convert paragraph properties dialog to .ui format
Convert Writer paragraph properties dialog to .ui widgets.
Reduced 2 different dialogs into one (bDrawParaDlg)
Conflicts:
sw/AllLangResTarget_sw.mk
Change-Id: I63135dda5416b8b503f9aa9f4986ce3ed08f535c
Reviewed-on: https://gerrit.libreoffice.org/4851
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/ui/chrdlg')
-rw-r--r-- | sw/source/ui/chrdlg/paradlg.hrc | 25 | ||||
-rw-r--r-- | sw/source/ui/chrdlg/paradlg.src | 128 | ||||
-rw-r--r-- | sw/source/ui/chrdlg/pardlg.cxx | 70 |
3 files changed, 41 insertions, 182 deletions
diff --git a/sw/source/ui/chrdlg/paradlg.hrc b/sw/source/ui/chrdlg/paradlg.hrc deleted file mode 100644 index d0f59f95cd2a..000000000000 --- a/sw/source/ui/chrdlg/paradlg.hrc +++ /dev/null @@ -1,25 +0,0 @@ -/* -*- 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 . - */ -#define TAB_CONTROL 55 -#define HYPHEN_BOX_AFTER 44 -#define HYPHEN_BOX_BEFORE 22 -#define OK_BTN 50 -#define CANCEL_BTN 51 - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/chrdlg/paradlg.src b/sw/source/ui/chrdlg/paradlg.src deleted file mode 100644 index 6435a96d5f10..000000000000 --- a/sw/source/ui/chrdlg/paradlg.src +++ /dev/null @@ -1,128 +0,0 @@ -/* -*- 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 . - */ - -#include "globals.hrc" -#include "chrdlg.hrc" -#include "paradlg.hrc" -#define HelpText "error - hier keine HelpTexte HelpText" -TabDialog DLG_PARA -{ - OutputSize = TRUE ; - SVLook = TRUE ; - Text [ en-US ] = "Paragraph" ; - Moveable = TRUE ; - TabControl 1 - { - OutputSize = TRUE ; - PageList = - { - PageItem - { - Identifier = TP_PARA_STD ; - Text [ en-US ] = "Indents & Spacing" ; - PageResID = TP_PARA_STD ; - }; - PageItem - { - Identifier = TP_PARA_ALIGN ; - PageResID = TP_PARA_ALIGN ; - Text [ en-US ] = "Alignment" ; - }; - PageItem - { - Identifier = TP_PARA_EXT ; - Text [ en-US ] = "Text Flow" ; - PageResID = TP_PARA_EXT ; - }; - PageItem - { - Identifier = TP_PARA_ASIAN; - Text [ en-US ] = "Asian Typography"; - }; - PageItem - { - Identifier = TP_NUMPARA ; - Text [ en-US ] = "Outline & Numbering" ; - }; - PageItem - { - Identifier = TP_TABULATOR ; - Text [ en-US ] = "Tabs" ; - PageResID = TP_TABULATOR ; - }; - PageItem - { - Identifier = TP_DROPCAPS ; - Text [ en-US ] = "Drop Caps" ; - PageResID = TP_DROPCAPS ; - }; - PageItem - { - Identifier = TP_BORDER ; - Text [ en-US ] = "Borders" ; - PageResID = TP_BORDER ; - }; - PageItem - { - Identifier = TP_BACKGROUND ; - Text [ en-US ] = "Background" ; - PageResID = TP_BACKGROUND ; - }; - }; - }; -}; -TabDialog DLG_DRAWPARA -{ - OutputSize = TRUE ; - SVLook = TRUE ; - Text [ en-US ] = "Paragraph" ; - Moveable = TRUE ; - TabControl 1 - { - OutputSize = TRUE ; - PageList = - { - PageItem - { - Identifier = TP_PARA_STD ; - Text [ en-US ] = "Indents & Spacing" ; - PageResID = TP_PARA_STD ; - }; - PageItem - { - Identifier = TP_PARA_ALIGN ; - PageResID = TP_PARA_ALIGN ; - Text [ en-US ] = "Alignment" ; - }; - PageItem - { - Identifier = TP_PARA_ASIAN; - Text [ en-US ] = "Asian Typography"; - }; - PageItem - { - Identifier = TP_TABULATOR ; - Text [ en-US ] = "Tabs" ; - PageResID = TP_TABULATOR ; - }; - }; - }; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/chrdlg/pardlg.cxx b/sw/source/ui/chrdlg/pardlg.cxx index f07337e80587..1073d2ef5ad6 100644 --- a/sw/source/ui/chrdlg/pardlg.cxx +++ b/sw/source/ui/chrdlg/pardlg.cxx @@ -19,6 +19,7 @@ #include "hintids.hxx" #include <sfx2/htmlmode.hxx> +#include <sfx2/tabdlg.hxx> #include <svl/style.hxx> #include <svtools/htmlcfg.hxx> #include <svl/cjkoptions.hxx> @@ -50,17 +51,15 @@ SwParaDlg::SwParaDlg(Window *pParent, const String *pTitle, sal_Bool bDraw, sal_uInt16 nDefPage): - - SfxTabDialog(pParent, bDraw ? SW_RES(DLG_DRAWPARA) : SW_RES(DLG_PARA), - &rCoreSet, 0 != pTitle), - + SfxTabDialog(pParent, + "ParagraphPropertiesDialog", + "modules/swriter/ui/paradialog.ui", + &rCoreSet, 0 != pTitle), rView(rVw), nDlgMode(nDialogMode), bDrawParaDlg(bDraw) { - FreeResource(); - nHtmlMode = ::GetHtmlMode(rVw.GetDocShell()); sal_Bool bHtmlMode = static_cast< sal_Bool >(nHtmlMode & HTMLMODE_ON); if(pTitle) @@ -72,76 +71,89 @@ SwParaDlg::SwParaDlg(Window *pParent, aTmp += ')'; SetText(aTmp); } + // tabs common to paragraph and draw paragraphs (paragraphs inside a text box) SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_STD_PARAGRAPH), "GetTabPageCreatorFunc fail!"); OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_STD_PARAGRAPH), "GetTabPageRangesFunc fail!"); - AddTabPage( TP_PARA_STD, pFact->GetTabPageCreatorFunc(RID_SVXPAGE_STD_PARAGRAPH), pFact->GetTabPageRangesFunc(RID_SVXPAGE_STD_PARAGRAPH) ); + m_nParaStd = AddTabPage("labelTP_PARA_STD", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_STD_PARAGRAPH), + pFact->GetTabPageRangesFunc(RID_SVXPAGE_STD_PARAGRAPH) ); OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_ALIGN_PARAGRAPH), "GetTabPageCreatorFunc fail!"); OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_ALIGN_PARAGRAPH), "GetTabPageRangesFunc fail!"); - AddTabPage( TP_PARA_ALIGN, pFact->GetTabPageCreatorFunc(RID_SVXPAGE_ALIGN_PARAGRAPH), pFact->GetTabPageRangesFunc(RID_SVXPAGE_ALIGN_PARAGRAPH) ); + m_nParaAlign = AddTabPage( "labelTP_PARA_ALIGN", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_ALIGN_PARAGRAPH), + pFact->GetTabPageRangesFunc(RID_SVXPAGE_ALIGN_PARAGRAPH) ); SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get(); if (!bDrawParaDlg && (!bHtmlMode || rHtmlOpt.IsPrintLayoutExtension())) { OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_EXT_PARAGRAPH), "GetTabPageCreatorFunc fail!"); OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_EXT_PARAGRAPH), "GetTabPageRangesFunc fail!"); - AddTabPage( TP_PARA_EXT, pFact->GetTabPageCreatorFunc(RID_SVXPAGE_EXT_PARAGRAPH), pFact->GetTabPageRangesFunc(RID_SVXPAGE_EXT_PARAGRAPH) ); + m_nParaExt = AddTabPage( "labelTP_PARA_EXT", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_EXT_PARAGRAPH), + pFact->GetTabPageRangesFunc(RID_SVXPAGE_EXT_PARAGRAPH) ); } else - RemoveTabPage(TP_PARA_EXT); + RemoveTabPage("labelTP_PARA_EXT"); SvtCJKOptions aCJKOptions; if(!bHtmlMode && aCJKOptions.IsAsianTypographyEnabled()) { OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PARA_ASIAN), "GetTabPageCreatorFunc fail!"); OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_PARA_ASIAN), "GetTabPageRangesFunc fail!"); - AddTabPage( TP_PARA_ASIAN, pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PARA_ASIAN), pFact->GetTabPageRangesFunc(RID_SVXPAGE_PARA_ASIAN) ); + m_nParaAsian = AddTabPage( "labelTP_PARA_ASIAN", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PARA_ASIAN), + pFact->GetTabPageRangesFunc(RID_SVXPAGE_PARA_ASIAN) ); } else - RemoveTabPage(TP_PARA_ASIAN); + RemoveTabPage("labelTP_PARA_ASIAN"); sal_uInt16 nWhich(rCoreSet.GetPool()->GetWhich(SID_ATTR_LRSPACE)); bool bLRValid = SFX_ITEM_AVAILABLE <= rCoreSet.GetItemState(nWhich); if(bHtmlMode || !bLRValid) - RemoveTabPage(TP_TABULATOR); + RemoveTabPage("labelTP_TABULATOR"); else { OSL_ENSURE(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_TABULATOR), "GetTabPageCreatorFunc fail!"); OSL_ENSURE(pFact->GetTabPageRangesFunc(RID_SVXPAGE_TABULATOR), "GetTabPageRangesFunc fail!"); - AddTabPage( TP_TABULATOR, pFact->GetTabPageCreatorFunc(RID_SVXPAGE_TABULATOR), pFact->GetTabPageRangesFunc(RID_SVXPAGE_TABULATOR) ); + m_nParaTab = AddTabPage( "labelTP_TABULATOR", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_TABULATOR), pFact->GetTabPageRangesFunc(RID_SVXPAGE_TABULATOR) ); + } + // remove unwanted tabs for draw text box paragraph properties + if (bDrawParaDlg) + { + RemoveTabPage("labelTP_NUMPARA"); + RemoveTabPage("labelTP_DROPCAPS"); + RemoveTabPage("labelTP_BACKGROUND"); + RemoveTabPage("labelTP_BORDER"); } - if (!bDrawParaDlg) + else { if(!(nDlgMode & DLG_ENVELOP)) - AddTabPage(TP_NUMPARA, SwParagraphNumTabPage::Create,SwParagraphNumTabPage::GetRanges); + m_nParaNumPara = AddTabPage("labelTP_NUMPARA", SwParagraphNumTabPage::Create, SwParagraphNumTabPage::GetRanges); else - RemoveTabPage(TP_NUMPARA); + RemoveTabPage("labelTP_NUMPARA"); if(!bHtmlMode || (nHtmlMode & HTMLMODE_FULL_STYLES)) { - AddTabPage(TP_DROPCAPS, SwDropCapsPage::Create, SwDropCapsPage::GetRanges); + m_nParaDrpCps = AddTabPage("labelTP_DROPCAPS", SwDropCapsPage::Create, SwDropCapsPage::GetRanges); } else { - RemoveTabPage(TP_DROPCAPS); + RemoveTabPage("labelTP_DROPCAPS"); } if(!bHtmlMode || (nHtmlMode & (HTMLMODE_SOME_STYLES|HTMLMODE_FULL_STYLES))) { OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!"); OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!"); - AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) ); + m_nParaBckGrnd = AddTabPage("labelTP_BACKGROUND", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) ); } else { - RemoveTabPage(TP_BACKGROUND); + RemoveTabPage("labelTP_BACKGROUND"); } OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!"); OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "GetTabPageRangesFunc fail!"); - AddTabPage(TP_BORDER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) ); + m_nParaBorder = AddTabPage("labelTP_BORDER", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) ); } if (nDefPage) @@ -160,12 +172,12 @@ void SwParaDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage) SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); // Table borders cannot get any shade in Writer - if (nId == TP_BORDER) + if (nId == m_nParaBorder) { aSet.Put (SfxUInt16Item(SID_SWMODE_TYPE,SW_BORDER_MODE_PARA)); rPage.PageCreated(aSet); } - else if( nId == TP_PARA_STD ) + else if( nId == m_nParaStd ) { aSet.Put(SfxUInt16Item(SID_SVXSTDPARAGRAPHTABPAGE_PAGEWIDTH, static_cast< sal_uInt16 >(rSh.GetAnyCurRect(RECT_PAGE_PRT).Width()) )); @@ -179,7 +191,7 @@ void SwParaDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage) } rPage.PageCreated(aSet); } - else if( TP_PARA_ALIGN == nId) + else if( m_nParaAlign == nId) { if (!bDrawParaDlg) { @@ -187,7 +199,7 @@ void SwParaDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage) rPage.PageCreated(aSet); } } - else if( TP_PARA_EXT == nId ) + else if( m_nParaExt == nId ) { // pagebreak only when the cursor is in the body-area and not in a table const sal_uInt16 eType = rSh.GetFrmType(0,sal_True); @@ -198,11 +210,11 @@ void SwParaDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage) rPage.PageCreated(aSet); } } - else if( TP_DROPCAPS == nId ) + else if( m_nParaDrpCps == nId ) { ((SwDropCapsPage&)rPage).SetFormat(sal_False); } - else if( TP_BACKGROUND == nId ) + else if( m_nParaBckGrnd == nId ) { if(!( nHtmlMode & HTMLMODE_ON ) || nHtmlMode & HTMLMODE_SOME_STYLES) @@ -211,7 +223,7 @@ void SwParaDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage) rPage.PageCreated(aSet); } } - else if( TP_NUMPARA == nId) + else if( m_nParaNumPara == nId) { SwTxtFmtColl* pTmpColl = rSh.GetCurTxtFmtColl(); if( pTmpColl && pTmpColl->IsAssignedToListLevelOfOutlineStyle() ) |