From c1e1de72609af2dc8ec7256f5505fcf673b2a73e Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 14 Oct 2013 13:48:34 +0100 Subject: convert captions option page to .ui Change-Id: I571cc68bacce315ceafbe54deed6efeac51a6f1f --- extras/source/glade/libreoffice-catalog.xml.in | 4 + sw/UIConfig_swriter.mk | 1 + sw/inc/globals.hrc | 2 +- sw/inc/helpid.h | 1 - sw/source/ui/app/app.src | 25 ++ sw/source/ui/app/appopt.cxx | 1 - sw/source/ui/cctrl/swlbox.cxx | 4 +- sw/source/ui/config/optload.cxx | 350 +++++++-------- sw/source/ui/config/optload.hrc | 58 --- sw/source/ui/config/optload.src | 250 ----------- sw/source/ui/dialog/swdlgfact.cxx | 1 - sw/source/ui/inc/app.hrc | 8 +- sw/source/ui/inc/bookmark.hxx | 2 +- sw/source/ui/inc/optload.hxx | 60 ++- sw/source/ui/inc/swlbox.hxx | 2 +- sw/source/ui/misc/bookmark.cxx | 6 +- sw/uiconfig/swriter/ui/insertcaption.ui | 4 +- sw/uiconfig/swriter/ui/optcaptionpage.ui | 582 +++++++++++++++++++++++++ 18 files changed, 822 insertions(+), 539 deletions(-) delete mode 100644 sw/source/ui/config/optload.hrc create mode 100644 sw/uiconfig/swriter/ui/optcaptionpage.ui diff --git a/extras/source/glade/libreoffice-catalog.xml.in b/extras/source/glade/libreoffice-catalog.xml.in index b3025e4d7c1b..0124f493fe6a 100644 --- a/extras/source/glade/libreoffice-catalog.xml.in +++ b/extras/source/glade/libreoffice-catalog.xml.in @@ -445,6 +445,10 @@ generic-name="SelectionListBox" parent="VclComboBoxText" icon-name="widget-gtk-comboboxtext"/> + + diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk index 64900b1eb7b8..c588dd05cc0c 100644 --- a/sw/UIConfig_swriter.mk +++ b/sw/UIConfig_swriter.mk @@ -145,6 +145,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\ sw/uiconfig/swriter/ui/objectdialog \ sw/uiconfig/swriter/ui/optcomparison \ sw/uiconfig/swriter/ui/optcompatpage \ + sw/uiconfig/swriter/ui/optcaptionpage \ sw/uiconfig/swriter/ui/optfonttabpage \ sw/uiconfig/swriter/ui/optformataidspage \ sw/uiconfig/swriter/ui/optgeneralpage \ diff --git a/sw/inc/globals.hrc b/sw/inc/globals.hrc index 5d0d28fc9132..1ea7adf09a17 100644 --- a/sw/inc/globals.hrc +++ b/sw/inc/globals.hrc @@ -122,7 +122,7 @@ // Sw-pages #define TP_OPTPRINT_PAGE (RC_GLOBALS_BEGIN + 26) -#define TP_OPTCAPTION_PAGE (RC_GLOBALS_BEGIN + 77) + #define DLG_SVXTEST_NUM_BULLET (RC_GLOBALS_BEGIN + 79) //maximum: RC_GLOBALS_BEGIN + 120 diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h index da7cb7eb6697..549685ef4d23 100644 --- a/sw/inc/helpid.h +++ b/sw/inc/helpid.h @@ -136,7 +136,6 @@ // TabPage Help-IDs #define HID_REDLINE_CTRL "SW_HID_REDLINE_CTRL" -#define HID_OPTCAPTION_PAGE "SW_HID_OPTCAPTION_PAGE" #define HID_ADD_STYLES_TLB "SW_HID_ADD_STYLES_TLB" #define HID_COMPATIBILITY_OPTIONS_BOX "SW_HID_COMPATIBILITY_OPTIONS_BOX" diff --git a/sw/source/ui/app/app.src b/sw/source/ui/app/app.src index a42d2defb1a8..a8a503c2d03d 100644 --- a/sw/source/ui/app/app.src +++ b/sw/source/ui/app/app.src @@ -713,4 +713,29 @@ String STR_ROTATE_TO_STANDARD_ORIENTATION Text [ en-US ] = "This image is rotated. Would you like to rotate it into standard orientation?"; }; +String STR_CAPTION_TABLE +{ + Text [ en-US ] = "%PRODUCTNAME Writer Table"; +}; + +String STR_CAPTION_FRAME +{ + Text [ en-US ] = "%PRODUCTNAME Writer Frame"; +}; + +String STR_CAPTION_GRAPHIC +{ + Text [ en-US ] = "%PRODUCTNAME Writer Picture"; +}; + +String STR_CAPTION_OLE +{ + Text [ en-US ] = "Other OLE Objects"; +}; + +String STR_CATEGORY_NONE +{ + Text [ en-US ] = "" ; +}; + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/app/appopt.cxx b/sw/source/ui/app/appopt.cxx index 4998dd91e75e..ea719eace8fb 100644 --- a/sw/source/ui/app/appopt.cxx +++ b/sw/source/ui/app/appopt.cxx @@ -543,7 +543,6 @@ SfxTabPage* SwModule::CreateTabPage( sal_uInt16 nId, Window* pParent, const SfxI } break; } - case TP_OPTCAPTION_PAGE: case RID_SW_TP_OPTCAPTION_PAGE: { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); diff --git a/sw/source/ui/cctrl/swlbox.cxx b/sw/source/ui/cctrl/swlbox.cxx index 54d37b3514ad..1ab23c8d2894 100644 --- a/sw/source/ui/cctrl/swlbox.cxx +++ b/sw/source/ui/cctrl/swlbox.cxx @@ -47,8 +47,8 @@ SwBoxEntry::SwBoxEntry(const SwBoxEntry& rOld) : { } -SwComboBox::SwComboBox(Window* pParent) - : ComboBox(pParent) +SwComboBox::SwComboBox(Window* pParent, WinBits nStyle) + : ComboBox(pParent, nStyle) { Init(); } diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx index 00d2170d61d5..a093d006c64e 100644 --- a/sw/source/ui/config/optload.cxx +++ b/sw/source/ui/config/optload.cxx @@ -34,7 +34,6 @@ #include "globals.hrc" #include "cmdid.h" -#include "optload.hrc" #include "optload.hxx" #include #include @@ -46,9 +45,11 @@ #include #include "svtools/treelistentry.hxx" +#include #include #include #include +#include #include #include #include @@ -322,16 +323,19 @@ SwCaptionOptDlg::~SwCaptionOptDlg() { } -SwCaptionPreview::SwCaptionPreview( Window* pParent ) - : Window( pParent ) +SwCaptionPreview::SwCaptionPreview( Window* pParent, WinBits nStyle ) + : Window( pParent, nStyle ) { Init(); } -SwCaptionPreview::SwCaptionPreview( Window* pParent, const ResId& rResId ) - : Window( pParent, rResId ) +extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSwCaptionPreview(Window *pParent, VclBuilder::stringmap &rMap) { - Init(); + WinBits nBits = 0; + OString sBorder = VclBuilder::extractCustomProperty(rMap); + if (!sBorder.isEmpty()) + nBits |= WB_BORDER; + return new SwCaptionPreview(pParent, nBits); } void SwCaptionPreview::Init() @@ -357,6 +361,11 @@ void SwCaptionPreview::SetPreviewText( const OUString& rText ) } } +Size SwCaptionPreview::GetOptimalSize() const +{ + return LogicToPixel(Size(106 , 20), MapMode(MAP_APPFONT)); +} + void SwCaptionPreview::Paint( const Rectangle& rRect ) { Window::Paint( rRect ); @@ -365,55 +374,41 @@ void SwCaptionPreview::Paint( const Rectangle& rRect ) DrawText( Point( 4, 6 ), maText ); } -extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSwCaptionPreview(Window* pParent, VclBuilder::stringmap &) -{ - return new SwCaptionPreview(pParent); -} - SwCaptionOptPage::SwCaptionOptPage( Window* pParent, const SfxItemSet& rSet ) - : SfxTabPage(pParent, SW_RES(TP_OPTCAPTION_PAGE), rSet), - aCheckFT (this, SW_RES(FT_OBJECTS )), - aCheckLB (this, SW_RES(CLB_OBJECTS )), - aFtCaptionOrder(this, SW_RES( FT_ORDER )), - aLbCaptionOrder(this, SW_RES( LB_ORDER )), - aPreview (this, SW_RES(WIN_PREVIEW )), - aSettingsGroupFL(this, SW_RES(FL_SETTINGS_2 )), - aCategoryText (this, SW_RES(TXT_CATEGORY )), - aCategoryBox (this, SW_RES(BOX_CATEGORY )), - aFormatText (this, SW_RES(TXT_FORMAT )), - aFormatBox (this, SW_RES(BOX_FORMAT )), - aNumberingSeparatorFT(this, SW_RES(FT_NUM_SEP )), - aNumberingSeparatorED(this, SW_RES(ED_NUM_SEP )), - aTextText (this, SW_RES(TXT_TEXT )), - aTextEdit (this, SW_RES(EDT_TEXT )), - aPosText (this, SW_RES(TXT_POS )), - aPosBox (this, SW_RES(BOX_POS )), - aNumCaptFL (this, SW_RES(FL_NUMCAPT )), - aFtLevel (this, SW_RES(FT_LEVEL )), - aLbLevel (this, SW_RES(LB_LEVEL )), - aFtDelim (this, SW_RES(FT_SEPARATOR )), - aEdDelim (this, SW_RES(ED_SEPARATOR )), - aCategoryFL (this, SW_RES(FL_CATEGORY )), - aCharStyleFT (this, SW_RES(FT_CHARSTYLE )), - aCharStyleLB (this, SW_RES(LB_CHARSTYLE )), - aApplyBorderCB (this, SW_RES(CB_APPLYBORDER)), - - m_sSWTable (SW_RES(STR_TABLE )), - m_sSWFrame (SW_RES(STR_FRAME )), - m_sSWGraphic (SW_RES(STR_GRAPHIC )), - m_sOLE (SW_RES(STR_OLE )), - - m_sBegin (SW_RESSTR(STR_BEGINNING )), - m_sEnd (SW_RESSTR(STR_END )), - m_sAbove (SW_RESSTR(STR_ABOVE )), - m_sBelow (SW_RESSTR(STR_CP_BELOW )), - m_sNone (SW_RESSTR( STR_CATEGORY_NONE )), - - pMgr (new SwFldMgr()), - bHTMLMode(sal_False) + : SfxTabPage(pParent, "OptCaptionPage", "modules/swriter/ui/optcaptionpage.ui", rSet) + , m_sSWTable(SW_RESSTR(STR_CAPTION_TABLE)) + , m_sSWFrame(SW_RESSTR(STR_CAPTION_FRAME)) + , m_sSWGraphic(SW_RESSTR(STR_CAPTION_GRAPHIC)) + , m_sOLE(SW_RESSTR(STR_CAPTION_OLE)) + , m_sBegin(SW_RESSTR(STR_CAPTION_BEGINNING)) + , m_sEnd(SW_RESSTR(STR_CAPTION_END)) + , m_sAbove(SW_RESSTR(STR_CAPTION_ABOVE)) + , m_sBelow(SW_RESSTR(STR_CAPTION_BELOW)) + , m_sNone(SW_RESSTR(STR_CATEGORY_NONE)) + , pMgr(new SwFldMgr()) + , bHTMLMode(false) { + get(m_pCheckLB, "objects"); + get(m_pLbCaptionOrder, "captionorder"); + get(m_pPreview, "preview"); + get(m_pSettingsGroup, "settings"); + get(m_pCategoryBox, "category"); + get(m_pFormatText, "numberingft"); + get(m_pFormatBox, "numbering"); + get(m_pNumberingSeparatorFT, "numseparatorft"); + get(m_pNumberingSeparatorED, "numseparator"); + get(m_pTextText, "separatorft"); + get(m_pTextEdit, "separator"); + get(m_pPosBox, "position"); + get(m_pNumCapt, "numcaption"); + get(m_pLbLevel, "level"); + get(m_pEdDelim, "chapseparator"); + get(m_pCategory, "categoryformat"); + get(m_pCharStyleLB, "charstyle"); + get(m_pApplyBorderCB, "applyborder"); + Wallpaper aBack( GetSettings().GetStyleSettings().GetWindowColor() ); - aPreview.SetBackground( aBack ); + m_pPreview->SetBackground( aBack ); SwStyleNameMapper::FillUIName(RES_POOLCOLL_LABEL_ABB, m_sIllustration); SwStyleNameMapper::FillUIName(RES_POOLCOLL_LABEL_TABLE, m_sTable); @@ -423,7 +418,7 @@ SwCaptionOptPage::SwCaptionOptPage( Window* pParent, const SfxItemSet& rSet ) sal_uInt16 i, nCount; SwWrtShell *pSh = ::GetActiveWrtShell(); - // aFormatBox + // m_pFormatBox sal_uInt16 nSelFmt = SVX_NUM_ARABIC; if (pSh) { @@ -432,29 +427,29 @@ SwCaptionOptPage::SwCaptionOptPage( Window* pParent, const SfxItemSet& rSet ) for ( i = nCount; i; ) { pFldType = pMgr->GetFldType(USHRT_MAX, --i); - if (pFldType->GetName().equals(aCategoryBox.GetText())) + if (pFldType->GetName().equals(m_pCategoryBox->GetText())) { nSelFmt = (sal_uInt16)((SwSetExpFieldType*)pFldType)->GetSeqFormat(); break; } } - ::FillCharStyleListBox( aCharStyleLB, pSh->GetView().GetDocShell(), true, true ); + ::FillCharStyleListBox( *m_pCharStyleLB, pSh->GetView().GetDocShell(), true, true ); } nCount = pMgr->GetFormatCount(TYP_SEQFLD, false); for ( i = 0; i < nCount; ++i ) { - aFormatBox.InsertEntry( pMgr->GetFormatStr(TYP_SEQFLD, i) ); + m_pFormatBox->InsertEntry( pMgr->GetFormatStr(TYP_SEQFLD, i) ); sal_uInt16 nFmtId = pMgr->GetFormatId(TYP_SEQFLD, i); - aFormatBox.SetEntryData( i, reinterpret_cast(nFmtId) ); + m_pFormatBox->SetEntryData( i, reinterpret_cast(nFmtId) ); if( nFmtId == nSelFmt ) - aFormatBox.SelectEntryPos( i ); + m_pFormatBox->SelectEntryPos( i ); } for (i = 0; i < MAXLEVEL; i++) - aLbLevel.InsertEntry(OUString::number(i + 1)); + m_pLbLevel->InsertEntry(OUString::number(i + 1)); sal_Unicode nLvl = MAXLEVEL; OUString sDelim(": "); @@ -462,7 +457,7 @@ SwCaptionOptPage::SwCaptionOptPage( Window* pParent, const SfxItemSet& rSet ) if (pSh) { SwSetExpFieldType* pFldType = (SwSetExpFieldType*)pMgr->GetFldType( - RES_SETEXPFLD, aCategoryBox.GetText() ); + RES_SETEXPFLD, m_pCategoryBox->GetText() ); if( pFldType ) { sDelim = pFldType->GetDelimiter(); @@ -470,27 +465,25 @@ SwCaptionOptPage::SwCaptionOptPage( Window* pParent, const SfxItemSet& rSet ) } } - aLbLevel.SelectEntryPos( nLvl < MAXLEVEL ? nLvl + 1 : 0 ); - aEdDelim.SetText( sDelim ); - - aCheckLB.SetHelpId(HID_OPTCAPTION_CLB); + m_pLbLevel->SelectEntryPos( nLvl < MAXLEVEL ? nLvl + 1 : 0 ); + m_pEdDelim->SetText( sDelim ); - FreeResource(); + m_pCheckLB->SetHelpId(HID_OPTCAPTION_CLB); Link aLk = LINK( this, SwCaptionOptPage, ModifyHdl ); - aCategoryBox.SetModifyHdl( aLk ); - aNumberingSeparatorED.SetModifyHdl( aLk ); - aTextEdit .SetModifyHdl( aLk ); + m_pCategoryBox->SetModifyHdl( aLk ); + m_pNumberingSeparatorED->SetModifyHdl( aLk ); + m_pTextEdit->SetModifyHdl( aLk ); aLk = LINK(this, SwCaptionOptPage, SelectHdl); - aCategoryBox.SetSelectHdl( aLk ); - aFormatBox .SetSelectHdl( aLk ); + m_pCategoryBox->SetSelectHdl( aLk ); + m_pFormatBox->SetSelectHdl( aLk ); - aLbCaptionOrder.SetSelectHdl( LINK(this, SwCaptionOptPage, OrderHdl)); + m_pLbCaptionOrder->SetSelectHdl( LINK(this, SwCaptionOptPage, OrderHdl)); - aCheckLB.SetSelectHdl( LINK(this, SwCaptionOptPage, ShowEntryHdl) ); - aCheckLB.SetCheckButtonHdl( LINK(this, SwCaptionOptPage, ShowEntryHdl) ); - aCheckLB.SetDeselectHdl( LINK(this, SwCaptionOptPage, SaveEntryHdl) ); + m_pCheckLB->SetSelectHdl( LINK(this, SwCaptionOptPage, ShowEntryHdl) ); + m_pCheckLB->SetCheckButtonHdl( LINK(this, SwCaptionOptPage, ShowEntryHdl) ); + m_pCheckLB->SetDeselectHdl( LINK(this, SwCaptionOptPage, SaveEntryHdl) ); } SwCaptionOptPage::~SwCaptionOptPage() @@ -510,21 +503,21 @@ sal_Bool SwCaptionOptPage::FillItemSet( SfxItemSet& ) sal_Bool bRet = sal_False; SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig(); - SaveEntry(aCheckLB.FirstSelected()); // apply current entry + SaveEntry(m_pCheckLB->FirstSelected()); // apply current entry - SvTreeListEntry* pEntry = aCheckLB.First(); + SvTreeListEntry* pEntry = m_pCheckLB->First(); while (pEntry) { InsCaptionOpt* pData = (InsCaptionOpt*)pEntry->GetUserData(); bRet |= pModOpt->SetCapOption(bHTMLMode, pData); - pEntry = aCheckLB.Next(pEntry); + pEntry = m_pCheckLB->Next(pEntry); } - sal_uInt16 nCheckCount = aCheckLB.GetCheckedEntryCount(); + sal_uInt16 nCheckCount = m_pCheckLB->GetCheckedEntryCount(); pModOpt->SetInsWithCaption( bHTMLMode, nCheckCount > 0 ); - sal_Int32 nPos = aLbCaptionOrder.GetSelectEntryPos(); + sal_Int32 nPos = m_pLbCaptionOrder->GetSelectEntryPos(); pModOpt->SetCaptionOrderNumberingFirst(nPos == 1 ? sal_True : sal_False ); return bRet; @@ -539,15 +532,15 @@ void SwCaptionOptPage::Reset( const SfxItemSet& rSet) } DelUserData(); - aCheckLB.GetModel()->Clear(); // remove all entries + m_pCheckLB->GetModel()->Clear(); // remove all entries // Writer objects sal_uInt16 nPos = 0; - aCheckLB.InsertEntry(m_sSWTable); + m_pCheckLB->InsertEntry(m_sSWTable); SetOptions(nPos++, TABLE_CAP); - aCheckLB.InsertEntry(m_sSWFrame); + m_pCheckLB->InsertEntry(m_sSWFrame); SetOptions(nPos++, FRAME_CAP); - aCheckLB.InsertEntry(m_sSWGraphic); + m_pCheckLB->InsertEntry(m_sSWGraphic); SetOptions(nPos++, GRAPHIC_CAP); // get Productname and -version @@ -570,10 +563,10 @@ void SwCaptionOptPage::Reset( const SfxItemSet& rSet) sClass = m_sOLE; // don't show product version sClass.SearchAndReplace( sComplete, sWithoutVersion ); - aCheckLB.InsertEntry( sClass ); + m_pCheckLB->InsertEntry( sClass ); SetOptions( nPos++, OLE_CAP, &rOleId ); } - aLbCaptionOrder.SelectEntryPos( + m_pLbCaptionOrder->SelectEntryPos( SW_MOD()->GetModuleConfig()->IsCaptionOrderNumberingFirst() ? 1 : 0); ModifyHdl(); } @@ -586,62 +579,48 @@ void SwCaptionOptPage::SetOptions(const sal_uInt16 nPos, if (pOpt) { - aCheckLB.SetEntryData(nPos, new InsCaptionOpt(*pOpt)); - aCheckLB.CheckEntryPos(nPos, pOpt->UseCaption()); + m_pCheckLB->SetEntryData(nPos, new InsCaptionOpt(*pOpt)); + m_pCheckLB->CheckEntryPos(nPos, pOpt->UseCaption()); } else - aCheckLB.SetEntryData(nPos, new InsCaptionOpt(eObjType, pOleId)); + m_pCheckLB->SetEntryData(nPos, new InsCaptionOpt(eObjType, pOleId)); } void SwCaptionOptPage::DelUserData() { - SvTreeListEntry* pEntry = aCheckLB.First(); + SvTreeListEntry* pEntry = m_pCheckLB->First(); while (pEntry) { delete (InsCaptionOpt*)pEntry->GetUserData(); pEntry->SetUserData(0); - pEntry = aCheckLB.Next(pEntry); + pEntry = m_pCheckLB->Next(pEntry); } } IMPL_LINK_NOARG(SwCaptionOptPage, ShowEntryHdl) { - SvTreeListEntry* pSelEntry = aCheckLB.FirstSelected(); + SvTreeListEntry* pSelEntry = m_pCheckLB->FirstSelected(); if (pSelEntry) { - sal_Bool bChecked = aCheckLB.IsChecked((sal_uInt16)aCheckLB.GetModel()->GetAbsPos(pSelEntry)); - - aSettingsGroupFL.Enable( bChecked ); - aCategoryText.Enable( bChecked ); - aCategoryBox.Enable( bChecked ); - aFormatText.Enable( bChecked ); - aFormatBox.Enable( bChecked ); - sal_Bool bNumSep = bChecked && aLbCaptionOrder.GetSelectEntryPos() == 1; - aNumberingSeparatorED.Enable( bNumSep ); - aNumberingSeparatorFT.Enable( bNumSep ); - aTextText.Enable( bChecked ); - aTextEdit.Enable( bChecked ); - aPosText.Enable( bChecked ); - aPosBox.Enable( bChecked ); - aNumCaptFL.Enable( bChecked ); - aFtLevel.Enable( bChecked ); - aLbLevel.Enable( bChecked ); - aFtDelim.Enable( bChecked ); - aEdDelim.Enable( bChecked ); - aCategoryFL.Enable( bChecked ); - aCharStyleFT.Enable( bChecked ); - aCharStyleLB.Enable( bChecked ); - aApplyBorderCB.Enable( bChecked ); - aPreview.Enable( bChecked ); + sal_Bool bChecked = m_pCheckLB->IsChecked((sal_uInt16)m_pCheckLB->GetModel()->GetAbsPos(pSelEntry)); + + m_pSettingsGroup->Enable(bChecked); + bool bNumSep = bChecked && m_pLbCaptionOrder->GetSelectEntryPos() == 1; + m_pNumberingSeparatorED->Enable( bNumSep ); + m_pNumberingSeparatorFT->Enable( bNumSep ); + + m_pNumCapt->Enable(bChecked); + m_pCategory->Enable(bChecked); + m_pPreview->Enable(bChecked); SwWrtShell *pSh = ::GetActiveWrtShell(); InsCaptionOpt* pOpt = (InsCaptionOpt*)pSelEntry->GetUserData(); - aCategoryBox.Clear(); - aCategoryBox.InsertEntry(m_sNone); + m_pCategoryBox->Clear(); + m_pCategoryBox->InsertEntry(m_sNone); if (pSh) { sal_uInt16 nCount = pMgr->GetFldTypeCount(); @@ -651,25 +630,25 @@ IMPL_LINK_NOARG(SwCaptionOptPage, ShowEntryHdl) SwFieldType *pType = pMgr->GetFldType( USHRT_MAX, i ); if( pType->Which() == RES_SETEXPFLD && ((SwSetExpFieldType *) pType)->GetType() & nsSwGetSetExpType::GSE_SEQ ) - aCategoryBox.InsertSwEntry(SwBoxEntry(pType->GetName())); + m_pCategoryBox->InsertSwEntry(SwBoxEntry(pType->GetName())); } } else { - aCategoryBox.InsertSwEntry(SwBoxEntry(m_sIllustration)); - aCategoryBox.InsertSwEntry(SwBoxEntry(m_sTable)); - aCategoryBox.InsertSwEntry(SwBoxEntry(m_sText)); - aCategoryBox.InsertSwEntry(SwBoxEntry(m_sDrawing)); + m_pCategoryBox->InsertSwEntry(SwBoxEntry(m_sIllustration)); + m_pCategoryBox->InsertSwEntry(SwBoxEntry(m_sTable)); + m_pCategoryBox->InsertSwEntry(SwBoxEntry(m_sText)); + m_pCategoryBox->InsertSwEntry(SwBoxEntry(m_sDrawing)); } if(!pOpt->GetCategory().isEmpty()) - aCategoryBox.SetText(pOpt->GetCategory()); + m_pCategoryBox->SetText(pOpt->GetCategory()); else - aCategoryBox.SetText(m_sNone); + m_pCategoryBox->SetText(m_sNone); if (!pOpt->GetCategory().isEmpty() && - aCategoryBox.GetEntryPos(OUString(pOpt->GetCategory())) == COMBOBOX_ENTRY_NOTFOUND) - aCategoryBox.InsertEntry(pOpt->GetCategory()); - if (aCategoryBox.GetText().isEmpty()) + m_pCategoryBox->GetEntryPos(OUString(pOpt->GetCategory())) == COMBOBOX_ENTRY_NOTFOUND) + m_pCategoryBox->InsertEntry(pOpt->GetCategory()); + if (m_pCategoryBox->GetText().isEmpty()) { sal_uInt16 nPos = 0; switch(pOpt->GetObjType()) @@ -679,50 +658,50 @@ IMPL_LINK_NOARG(SwCaptionOptPage, ShowEntryHdl) case TABLE_CAP: nPos = 2; break; case FRAME_CAP: nPos = 3; break; } - aCategoryBox.SetText(aCategoryBox.GetSwEntry(nPos).GetName()); + m_pCategoryBox->SetText(m_pCategoryBox->GetSwEntry(nPos).GetName()); } - for (sal_uInt16 i = 0; i < aFormatBox.GetEntryCount(); i++) + for (sal_uInt16 i = 0; i < m_pFormatBox->GetEntryCount(); i++) { - if (pOpt->GetNumType() == (sal_uInt16)(sal_uLong)aFormatBox.GetEntryData(i)) + if (pOpt->GetNumType() == (sal_uInt16)(sal_uLong)m_pFormatBox->GetEntryData(i)) { - aFormatBox.SelectEntryPos(i); + m_pFormatBox->SelectEntryPos(i); break; } } - aTextEdit.SetText(pOpt->GetCaption()); + m_pTextEdit->SetText(pOpt->GetCaption()); - aPosBox.Clear(); + m_pPosBox->Clear(); switch (pOpt->GetObjType()) { case GRAPHIC_CAP: case TABLE_CAP: case OLE_CAP: - aPosBox.InsertEntry(m_sAbove); - aPosBox.InsertEntry(m_sBelow); + m_pPosBox->InsertEntry(m_sAbove); + m_pPosBox->InsertEntry(m_sBelow); break; case FRAME_CAP: - aPosBox.InsertEntry(m_sBegin); - aPosBox.InsertEntry(m_sEnd); + m_pPosBox->InsertEntry(m_sBegin); + m_pPosBox->InsertEntry(m_sEnd); break; } - aPosBox.SelectEntryPos(pOpt->GetPos()); - aPosBox.Enable( pOpt->GetObjType() != GRAPHIC_CAP && + m_pPosBox->SelectEntryPos(pOpt->GetPos()); + m_pPosBox->Enable( pOpt->GetObjType() != GRAPHIC_CAP && pOpt->GetObjType() != OLE_CAP && - aPosText.IsEnabled() ); - aPosBox.SelectEntryPos(pOpt->GetPos()); + m_pPosBox->IsEnabled() ); + m_pPosBox->SelectEntryPos(pOpt->GetPos()); sal_uInt16 nLevelPos = ( pOpt->GetLevel() < MAXLEVEL ) ? pOpt->GetLevel() + 1 : 0; - aLbLevel.SelectEntryPos( nLevelPos ); - aEdDelim.SetText(pOpt->GetSeparator()); - aNumberingSeparatorED.SetText( pOpt->GetNumSeparator() ); + m_pLbLevel->SelectEntryPos( nLevelPos ); + m_pEdDelim->SetText(pOpt->GetSeparator()); + m_pNumberingSeparatorED->SetText( pOpt->GetNumSeparator() ); if(!pOpt->GetCharacterStyle().isEmpty()) - aCharStyleLB.SelectEntry( pOpt->GetCharacterStyle() ); + m_pCharStyleLB->SelectEntry( pOpt->GetCharacterStyle() ); else - aCharStyleLB.SelectEntryPos( 0 ); - aApplyBorderCB.Enable( aCategoryBox.IsEnabled() && + m_pCharStyleLB->SelectEntryPos( 0 ); + m_pApplyBorderCB->Enable( m_pCategoryBox->IsEnabled() && pOpt->GetObjType() != TABLE_CAP && pOpt->GetObjType() != FRAME_CAP ); - aApplyBorderCB.Check( pOpt->CopyAttributes() ); + m_pApplyBorderCB->Check( pOpt->CopyAttributes() ); } ModifyHdl(); @@ -732,7 +711,7 @@ IMPL_LINK_NOARG(SwCaptionOptPage, ShowEntryHdl) IMPL_LINK_NOARG(SwCaptionOptPage, SaveEntryHdl) { - SvTreeListEntry* pEntry = aCheckLB.GetHdlEntry(); + SvTreeListEntry* pEntry = m_pCheckLB->GetHdlEntry(); if (pEntry) // save all SaveEntry(pEntry); @@ -746,42 +725,42 @@ void SwCaptionOptPage::SaveEntry(SvTreeListEntry* pEntry) { InsCaptionOpt* pOpt = (InsCaptionOpt*)pEntry->GetUserData(); - pOpt->UseCaption() = aCheckLB.IsChecked((sal_uInt16)aCheckLB.GetModel()->GetAbsPos(pEntry)); - String aName( aCategoryBox.GetText() ); + pOpt->UseCaption() = m_pCheckLB->IsChecked((sal_uInt16)m_pCheckLB->GetModel()->GetAbsPos(pEntry)); + String aName( m_pCategoryBox->GetText() ); if (aName == m_sNone) pOpt->SetCategory(aEmptyStr); else pOpt->SetCategory(comphelper::string::strip(aName, ' ')); - pOpt->SetNumType((sal_uInt16)(sal_uLong)aFormatBox.GetEntryData(aFormatBox.GetSelectEntryPos())); - pOpt->SetCaption(aTextEdit.IsEnabled() ? aTextEdit.GetText() : OUString(aEmptyStr) ); - pOpt->SetPos(aPosBox.GetSelectEntryPos()); - sal_uInt16 nPos = aLbLevel.GetSelectEntryPos(); + pOpt->SetNumType((sal_uInt16)(sal_uLong)m_pFormatBox->GetEntryData(m_pFormatBox->GetSelectEntryPos())); + pOpt->SetCaption(m_pTextEdit->IsEnabled() ? m_pTextEdit->GetText() : OUString(aEmptyStr) ); + pOpt->SetPos(m_pPosBox->GetSelectEntryPos()); + sal_uInt16 nPos = m_pLbLevel->GetSelectEntryPos(); sal_uInt16 nLevel = ( nPos > 0 && nPos != LISTBOX_ENTRY_NOTFOUND ) ? nPos - 1 : MAXLEVEL; pOpt->SetLevel(nLevel); - pOpt->SetSeparator(aEdDelim.GetText()); - pOpt->SetNumSeparator( aNumberingSeparatorED.GetText()); - if(!aCharStyleLB.GetSelectEntryPos()) + pOpt->SetSeparator(m_pEdDelim->GetText()); + pOpt->SetNumSeparator( m_pNumberingSeparatorED->GetText()); + if(!m_pCharStyleLB->GetSelectEntryPos()) pOpt->SetCharacterStyle(aEmptyStr); else - pOpt->SetCharacterStyle(aCharStyleLB.GetSelectEntry()); - pOpt->CopyAttributes() = aApplyBorderCB.IsChecked(); + pOpt->SetCharacterStyle(m_pCharStyleLB->GetSelectEntry()); + pOpt->CopyAttributes() = m_pApplyBorderCB->IsChecked(); } } IMPL_LINK_NOARG(SwCaptionOptPage, ModifyHdl) { - String sFldTypeName = aCategoryBox.GetText(); + String sFldTypeName = m_pCategoryBox->GetText(); SfxNoLayoutSingleTabDialog *pDlg = dynamic_cast(GetParentDialog()); PushButton *pBtn = pDlg ? pDlg->GetOKButton() : NULL; if (pBtn) pBtn->Enable(sFldTypeName.Len() != 0); - sal_Bool bEnable = aCategoryBox.IsEnabled() && sFldTypeName != m_sNone; + bool bEnable = m_pCategoryBox->IsEnabled() && sFldTypeName != m_sNone; - aFormatText.Enable(bEnable); - aFormatBox.Enable(bEnable); - aTextText.Enable(bEnable); - aTextEdit.Enable(bEnable); + m_pFormatText->Enable(bEnable); + m_pFormatBox->Enable(bEnable); + m_pTextText->Enable(bEnable); + m_pTextEdit->Enable(bEnable); DrawSample(); return 0; @@ -798,16 +777,16 @@ IMPL_LINK( SwCaptionOptPage, OrderHdl, ListBox*, pBox ) { DrawSample(); - SvTreeListEntry* pSelEntry = aCheckLB.FirstSelected(); + SvTreeListEntry* pSelEntry = m_pCheckLB->FirstSelected(); sal_Bool bChecked = sal_False; if (pSelEntry) { - bChecked = aCheckLB.IsChecked((sal_uInt16)aCheckLB.GetModel()->GetAbsPos(pSelEntry)); + bChecked = m_pCheckLB->IsChecked((sal_uInt16)m_pCheckLB->GetModel()->GetAbsPos(pSelEntry)); } sal_Int32 nPos = pBox->GetSelectEntryPos(); - aNumberingSeparatorFT.Enable( bChecked && nPos == 1 ); - aNumberingSeparatorED.Enable( bChecked && nPos == 1 ); + m_pNumberingSeparatorFT->Enable( bChecked && nPos == 1 ); + m_pNumberingSeparatorED->Enable( bChecked && nPos == 1 ); return 0; } @@ -815,25 +794,25 @@ void SwCaptionOptPage::DrawSample() { String aStr; - if( aCategoryBox.GetText() != m_sNone) + if( m_pCategoryBox->GetText() != m_sNone) { //#i61007# order of captions - bool bOrderNumberingFirst = aLbCaptionOrder.GetSelectEntryPos() == 1; + bool bOrderNumberingFirst = m_pLbCaptionOrder->GetSelectEntryPos() == 1; // number - sal_uInt16 nNumFmt = (sal_uInt16)(sal_uLong)aFormatBox.GetEntryData( - aFormatBox.GetSelectEntryPos() ); + sal_uInt16 nNumFmt = (sal_uInt16)(sal_uLong)m_pFormatBox->GetEntryData( + m_pFormatBox->GetSelectEntryPos() ); if( SVX_NUM_NUMBER_NONE != nNumFmt ) { //#i61007# order of captions if( !bOrderNumberingFirst ) { // category - aStr += aCategoryBox.GetText(); + aStr += m_pCategoryBox->GetText(); aStr += ' '; } SwWrtShell *pSh = ::GetActiveWrtShell(); - String sFldTypeName( aCategoryBox.GetText() ); + String sFldTypeName( m_pCategoryBox->GetText() ); if (pSh) { SwSetExpFieldType* pFldType = (SwSetExpFieldType*)pMgr->GetFldType( @@ -867,12 +846,12 @@ void SwCaptionOptPage::DrawSample() //#i61007# order of captions if( bOrderNumberingFirst ) { - aStr += aNumberingSeparatorED.GetText(); - aStr += aCategoryBox.GetText(); + aStr += m_pNumberingSeparatorED->GetText(); + aStr += m_pCategoryBox->GetText(); } - aStr += aTextEdit.GetText(); + aStr += m_pTextEdit->GetText(); } - aPreview.SetPreviewText( aStr ); + m_pPreview->SetPreviewText( aStr ); } // Description: ComboBox without Spaces @@ -882,6 +861,15 @@ void CaptionComboBox::KeyInput(const KeyEvent& rEvt) SwComboBox::KeyInput(rEvt); } - +extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeCaptionComboBox(Window *pParent, VclBuilder::stringmap &rMap) +{ + WinBits nBits = WB_CLIPCHILDREN|WB_LEFT|WB_VCENTER|WB_3DLOOK; + bool bDropdown = VclBuilder::extractDropdown(rMap); + if (bDropdown) + nBits |= WB_DROPDOWN; + CaptionComboBox* pComboBox = new CaptionComboBox(pParent, nBits); + pComboBox->EnableAutoSize(true); + return pComboBox; +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/config/optload.hrc b/sw/source/ui/config/optload.hrc deleted file mode 100644 index 4a391915d931..000000000000 --- a/sw/source/ui/config/optload.hrc +++ /dev/null @@ -1,58 +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 . - */ - -// SwCaptionOptPage ----------------------------- - -#define FT_OBJECTS 10 -#define CLB_OBJECTS 11 -#define FL_SETTINGS_2 12 -#define TXT_CATEGORY 13 -#define BOX_CATEGORY 14 -#define TXT_FORMAT 15 -#define BOX_FORMAT 16 -#define TXT_TEXT 17 -#define EDT_TEXT 18 -#define TXT_POS 19 -#define BOX_POS 20 -#define FL_NUMCAPT 21 -#define FT_LEVEL 22 -#define LB_LEVEL 23 -#define FT_SEPARATOR 24 -#define ED_SEPARATOR 25 -#define FL_CATEGORY 26 -#define FT_CHARSTYLE 27 -#define LB_CHARSTYLE 28 -#define CB_APPLYBORDER 29 -#define WIN_PREVIEW 30 -#define STR_CATEGORY_NONE 31 -#define LB_ORDER 32 -#define FT_ORDER 33 -#define FT_NUM_SEP 34 -#define ED_NUM_SEP 35 - -#define STR_TABLE 10 -#define STR_FRAME 11 -#define STR_GRAPHIC 12 -#define STR_OLE 13 -#define STR_BEGINNING 14 -#define STR_END 15 -#define STR_ABOVE 16 -#define STR_CP_BELOW 17 - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/config/optload.src b/sw/source/ui/config/optload.src index d3de153ace1e..855acbb809bb 100644 --- a/sw/source/ui/config/optload.src +++ b/sw/source/ui/config/optload.src @@ -17,258 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "globals.hrc" -#include "optload.hrc" -#include "helpid.h" #include "config.hrc" -TabPage TP_OPTCAPTION_PAGE -{ - HelpID = HID_OPTCAPTION_PAGE ; - Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ; - Hide = TRUE ; - Text [ en-US ] = "Caption" ; - - FixedText FT_OBJECTS - { - Pos = MAP_APPFONT ( 6 , 6 ) ; - Size = MAP_APPFONT ( 106 , 20 ) ; - WordBreak = TRUE ; - Text [ en-US ] = "Add captions automatically\nwhen inserting:" ; - }; - Control CLB_OBJECTS - { - Pos = MAP_APPFONT ( 6 , 29 ) ; - Size = MAP_APPFONT ( 106 , 97 ) ; - Border = TRUE ; - TabStop = TRUE ; - }; - FixedText FT_ORDER - { - Pos = MAP_APPFONT ( 6 , 130 ) ; - Size = MAP_APPFONT ( 106 , 8 ) ; - Text [ en-US ] = "Caption order" ; - }; - ListBox LB_ORDER - { - HelpID = "sw:ListBox:TP_OPTCAPTION_PAGE:LB_ORDER"; - Border = TRUE ; - Pos = MAP_APPFONT ( 6 , 141 ) ; - Size = MAP_APPFONT ( 106 , 60 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - StringList [ en-US ] = - { - < "Category first" ; > ; - < "Numbering first" ; > ; - }; - }; - Window WIN_PREVIEW - { - Pos = MAP_APPFONT ( 6 , 159 ) ; - Size = MAP_APPFONT ( 106 , 20 ) ; - Border = TRUE; - }; - String STR_TABLE - { - Text [ en-US ] = "%PRODUCTNAME Writer Table"; - }; - String STR_FRAME - { - Text [ en-US ] = "%PRODUCTNAME Writer Frame"; - }; - String STR_GRAPHIC - { - Text [ en-US ] = "%PRODUCTNAME Writer Picture"; - }; - String STR_OLE - { - Text [ en-US ] = "Other OLE Objects"; - }; - - FixedLine FL_SETTINGS_2 - { - Pos = MAP_APPFONT ( 118 , 3 ) ; - Size = MAP_APPFONT ( 136 , 8 ) ; - Text [ en-US ] = "Caption" ; - }; - FixedText TXT_CATEGORY - { - Pos = MAP_APPFONT ( 125 , 16 ) ; - Size = MAP_APPFONT ( 59 , 10 ) ; - Text [ en-US ] = "Category" ; - Left = TRUE ; - }; - ComboBox BOX_CATEGORY - { - HelpID = "sw:ComboBox:TP_OPTCAPTION_PAGE:BOX_CATEGORY"; - Pos = MAP_APPFONT ( 189 , 14 ) ; - Size = MAP_APPFONT ( 59 , 61 ) ; - DropDown = TRUE ; - TabStop = TRUE ; - Sort = TRUE ; - }; - FixedText TXT_FORMAT - { - Pos = MAP_APPFONT ( 125 , 31 ) ; - Size = MAP_APPFONT ( 59 , 10 ) ; - Text [ en-US ] = "~Numbering" ; - Left = TRUE ; - }; - ListBox BOX_FORMAT - { - HelpID = "sw:ListBox:TP_OPTCAPTION_PAGE:BOX_FORMAT"; - Border = TRUE ; - Pos = MAP_APPFONT ( 189 , 29 ) ; - Size = MAP_APPFONT ( 59 , 61 ) ; - DropDown = TRUE ; - TabStop = TRUE ; - }; - FixedText FT_NUM_SEP - { - Pos = MAP_APPFONT ( 125 , 46 ) ; - Size = MAP_APPFONT ( 61 , 8 ) ; - Text [ en-US ] = "Numbering separator" ; - Left = TRUE ; - }; - Edit ED_NUM_SEP - { - HelpID = "sw:Edit:TP_OPTCAPTION_PAGE:ED_NUM_SEP"; - Pos = MAP_APPFONT ( 189 , 44 ) ; - Size = MAP_APPFONT ( 59 , 12 ) ; - Border = TRUE ; - TabStop = TRUE ; - Left = TRUE ; - Text = ". " ; - }; - FixedText TXT_TEXT - { - Pos = MAP_APPFONT ( 125 , 60 ) ; - Size = MAP_APPFONT ( 59 , 10 ) ; - Text [ en-US ] = "Separator" ; - Left = TRUE ; - }; - Edit EDT_TEXT - { - HelpID = "sw:Edit:TP_OPTCAPTION_PAGE:EDT_TEXT"; - Pos = MAP_APPFONT ( 189 , 59 ) ; - Size = MAP_APPFONT ( 59 , 12 ) ; - Border = TRUE ; - TabStop = TRUE ; - Left = TRUE ; - }; - FixedText TXT_POS - { - Pos = MAP_APPFONT ( 125 , 75 ) ; - Size = MAP_APPFONT ( 59 , 10 ) ; - Left = TRUE ; - Text [ en-US ] = "Position" ; - }; - ListBox BOX_POS - { - HelpID = "sw:ListBox:TP_OPTCAPTION_PAGE:BOX_POS"; - Pos = MAP_APPFONT ( 189 , 74 ) ; - Size = MAP_APPFONT ( 59 , 61 ) ; - DropDown = TRUE ; - TabStop = TRUE ; - Border = TRUE ; - }; - - FixedLine FL_NUMCAPT - { - Pos = MAP_APPFONT ( 118 , 89 ) ; - Size = MAP_APPFONT ( 136 , 8 ) ; - Text [ en-US ] = "Numbering captions by chapter" ; - }; - FixedText FT_LEVEL - { - Pos = MAP_APPFONT ( 125 , 102 ) ; - Size = MAP_APPFONT ( 59 , 10 ) ; - Text [ en-US ] = "Level" ; - }; - ListBox LB_LEVEL - { - HelpID = "sw:ListBox:TP_OPTCAPTION_PAGE:LB_LEVEL"; - Border = TRUE ; - Pos = MAP_APPFONT ( 189 , 100 ) ; - Size = MAP_APPFONT ( 59 , 60 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - StringList [ en-US ] = - { - < "None" ; > ; - }; - }; - FixedText FT_SEPARATOR - { - Pos = MAP_APPFONT ( 125 , 117 ) ; - Size = MAP_APPFONT ( 59 , 10 ) ; - Text [ en-US ] = "Separator" ; - }; - Edit ED_SEPARATOR - { - HelpID = "sw:Edit:TP_OPTCAPTION_PAGE:ED_SEPARATOR"; - Pos = MAP_APPFONT ( 189 , 115 ) ; - Size = MAP_APPFONT ( 59 , 12 ) ; - Border = TRUE ; - MaxTextLength = 1 ; - TEXT = "." ; - }; - FixedLine FL_CATEGORY - { - Pos = MAP_APPFONT ( 118 , 130 ) ; - Size = MAP_APPFONT ( 136 , 8 ) ; - Text [ en-US ] = "Category and frame format" ; - }; - FixedText FT_CHARSTYLE - { - Pos = MAP_APPFONT ( 125 , 143 ) ; - Size = MAP_APPFONT ( 59 , 10 ) ; - Text [ en-US ] = "Character style" ; - }; - ListBox LB_CHARSTYLE - { - HelpID = "sw:ListBox:TP_OPTCAPTION_PAGE:LB_CHARSTYLE"; - Border = TRUE ; - Pos = MAP_APPFONT ( 189 , 141 ) ; - Size = MAP_APPFONT ( 59 , 60 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - StringList [ en-US ] = - { - < "None" ; > ; - }; - }; - CheckBox CB_APPLYBORDER - { - HelpID = "sw:CheckBox:TP_OPTCAPTION_PAGE:CB_APPLYBORDER"; - Pos = MAP_APPFONT ( 125 , 158 ) ; - Size = MAP_APPFONT ( 124 , 10 ) ; - Text [ en-US ] = "Apply border and shadow" ; - }; - - String STR_BEGINNING - { - Text [ en-US ] = "At the beginning" ; - }; - String STR_END - { - Text [ en-US ] = "At the end" ; - }; - String STR_ABOVE - { - Text [ en-US ] = "Above" ; - }; - String STR_CP_BELOW - { - Text [ en-US ] = "Below" ; - }; - String STR_CATEGORY_NONE - { - Text [ en-US ] = "" ; - }; -}; - StringArray STR_ARR_METRIC { ItemList [ en-US ] = diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index eb6722eb9728..32a4b9a26cb9 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -1142,7 +1142,6 @@ CreateTabPage SwAbstractDialogFactory_Impl::GetTabPageCreatorFunc( sal_uInt16 nI case RID_SW_TP_OPTLOAD_PAGE : pRet = SwLoadOptPage::Create; break; - case TP_OPTCAPTION_PAGE: case RID_SW_TP_OPTCAPTION_PAGE: return SwCaptionOptPage::Create; case RID_SW_TP_CONTENT_OPT: diff --git a/sw/source/ui/inc/app.hrc b/sw/source/ui/inc/app.hrc index d28ae331c9da..373478813a66 100644 --- a/sw/source/ui/inc/app.hrc +++ b/sw/source/ui/inc/app.hrc @@ -101,10 +101,14 @@ #define STR_SIMPLE (RC_APP_BEGIN + 129) #define STR_AUTHMRK_EDIT (RC_APP_BEGIN + 130) #define STR_AUTHMRK_INSERT (RC_APP_BEGIN + 131) - #define STR_ROTATE_TO_STANDARD_ORIENTATION (RC_APP_BEGIN + 132) +#define STR_CAPTION_TABLE (RC_APP_BEGIN + 133) +#define STR_CAPTION_FRAME (RC_APP_BEGIN + 134) +#define STR_CAPTION_GRAPHIC (RC_APP_BEGIN + 135) +#define STR_CAPTION_OLE (RC_APP_BEGIN + 136) +#define STR_CATEGORY_NONE (RC_APP_BEGIN + 137) -#define APP_ACT_END STR_ROTATE_TO_STANDARD_ORIENTATION +#define APP_ACT_END STR_CATEGORY_NONE #if APP_ACT_END > RC_APP_END #error Resource-Id Ueberlauf in #file, #line diff --git a/sw/source/ui/inc/bookmark.hxx b/sw/source/ui/inc/bookmark.hxx index f57ad5896bb0..372df26ee9e4 100644 --- a/sw/source/ui/inc/bookmark.hxx +++ b/sw/source/ui/inc/bookmark.hxx @@ -37,7 +37,7 @@ class BookmarkCombo : public SwComboBox virtual long PreNotify(NotifyEvent& rNEvt); public: - BookmarkCombo( Window* pWin ); + BookmarkCombo(Window* pWin, WinBits nStyle); sal_uInt16 GetSelectEntryCount() const; sal_uInt16 GetSelectEntryPos( sal_uInt16 nSelIndex = 0 ) const; diff --git a/sw/source/ui/inc/optload.hxx b/sw/source/ui/inc/optload.hxx index 0e5fff175133..3bf231e5bbde 100644 --- a/sw/source/ui/inc/optload.hxx +++ b/sw/source/ui/inc/optload.hxx @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -81,8 +82,8 @@ protected: virtual void KeyInput( const KeyEvent& ); public: - CaptionComboBox( Window* pParent, const ResId& rResId) - : SwComboBox(pParent, rResId) + CaptionComboBox(Window* pParent, WinBits nStyle) + : SwComboBox(pParent, nStyle) {} }; @@ -92,47 +93,38 @@ private: OUString maText; Point maDrawPos; public: - SwCaptionPreview( Window* pParent ); - SwCaptionPreview( Window* pParent, const ResId& rResId ); + SwCaptionPreview( Window* pParent, WinBits nStyle ); void Init(); void SetPreviewText( const OUString& rText ); virtual void Paint( const Rectangle& rRect ); + virtual Size GetOptimalSize() const; }; class SwCaptionOptPage : public SfxTabPage { private: - FixedText aCheckFT; - SvxCheckListBox aCheckLB; - - FixedText aFtCaptionOrder; - ListBox aLbCaptionOrder; - - SwCaptionPreview aPreview; - - FixedLine aSettingsGroupFL; - FixedText aCategoryText; - CaptionComboBox aCategoryBox; - FixedText aFormatText; - ListBox aFormatBox; + SvxCheckListBox* m_pCheckLB; + ListBox* m_pLbCaptionOrder; + SwCaptionPreview* m_pPreview; + + VclContainer* m_pSettingsGroup; + CaptionComboBox* m_pCategoryBox; + FixedText* m_pFormatText; + ListBox* m_pFormatBox; //#i61007# order of captions - FixedText aNumberingSeparatorFT; - Edit aNumberingSeparatorED; - FixedText aTextText; - Edit aTextEdit; - FixedText aPosText; - ListBox aPosBox; - - FixedLine aNumCaptFL; - FixedText aFtLevel; - ListBox aLbLevel; - FixedText aFtDelim; - Edit aEdDelim; - - FixedLine aCategoryFL; - FixedText aCharStyleFT; - ListBox aCharStyleLB; - CheckBox aApplyBorderCB; + FixedText* m_pNumberingSeparatorFT; + Edit* m_pNumberingSeparatorED; + FixedText* m_pTextText; + Edit* m_pTextEdit; + ListBox* m_pPosBox; + + VclContainer* m_pNumCapt; + ListBox* m_pLbLevel; + Edit* m_pEdDelim; + + VclContainer* m_pCategory; + ListBox* m_pCharStyleLB; + CheckBox* m_pApplyBorderCB; OUString m_sSWTable; OUString m_sSWFrame; diff --git a/sw/source/ui/inc/swlbox.hxx b/sw/source/ui/inc/swlbox.hxx index 0ae0b7400934..747ffb76dd08 100644 --- a/sw/source/ui/inc/swlbox.hxx +++ b/sw/source/ui/inc/swlbox.hxx @@ -66,7 +66,7 @@ class SW_DLLPUBLIC SwComboBox : public ComboBox public: - SwComboBox(Window* pParent); + SwComboBox(Window* pParent, WinBits nStyle); SwComboBox(Window* pParent, const ResId& rId); ~SwComboBox(); diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx index 1ff4990aa9fd..c1a7026e511e 100644 --- a/sw/source/ui/misc/bookmark.cxx +++ b/sw/source/ui/misc/bookmark.cxx @@ -157,8 +157,8 @@ SwInsertBookmarkDlg::~SwInsertBookmarkDlg() { } -BookmarkCombo::BookmarkCombo(Window* pWin) - : SwComboBox(pWin) +BookmarkCombo::BookmarkCombo(Window* pWin, WinBits nStyle) + : SwComboBox(pWin, nStyle) { } @@ -242,7 +242,7 @@ long BookmarkCombo::PreNotify( NotifyEvent& rNEvt ) extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeBookmarkCombo(Window* pParent, VclBuilder::stringmap &) { - return new BookmarkCombo(pParent); + return new BookmarkCombo(pParent, 0); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/uiconfig/swriter/ui/insertcaption.ui b/sw/uiconfig/swriter/ui/insertcaption.ui index a6e43b3af0ea..7b48d140f4c7 100644 --- a/sw/uiconfig/swriter/ui/insertcaption.ui +++ b/sw/uiconfig/swriter/ui/insertcaption.ui @@ -282,9 +282,7 @@ 6 12 - - 200 - 50 + True False diff --git a/sw/uiconfig/swriter/ui/optcaptionpage.ui b/sw/uiconfig/swriter/ui/optcaptionpage.ui new file mode 100644 index 000000000000..c7b4f16faa22 --- /dev/null +++ b/sw/uiconfig/swriter/ui/optcaptionpage.ui @@ -0,0 +1,582 @@ + + + + + + True + False + 6 + vertical + 12 + + + True + False + 12 + + + True + False + start + 12 + + + True + False + True + 0 + none + + + True + False + True + 6 + 12 + + + True + False + True + 6 + 12 + True + + + True + False + 0 + Category + True + category + + + 0 + 0 + 1 + 1 + + + + + True + False + 0 + _Numbering + True + numbering + + + 0 + 1 + 1 + 1 + + + + + True + False + 0 + Numbering separator + True + numseparator + + + 0 + 2 + 1 + 1 + + + + + True + False + 0 + Separator + True + separator + + + 0 + 3 + 1 + 1 + + + + + True + False + 0 + Position + True + position + + + 0 + 4 + 1 + 1 + + + + + True + False + center + True + 0 + 1 + + + 1 + 4 + 1 + 1 + + + + + True + True + center + True + + True + + + 1 + 3 + 1 + 1 + + + + + True + True + center + True + + . + True + + + 1 + 2 + 1 + 1 + + + + + True + False + center + True + 0 + 1 + + + 1 + 1 + 1 + 1 + + + + + True + False + center + True + True + 0 + 1 + + + False + + + + + 1 + 0 + 1 + 1 + + + + + + + + + True + False + Caption + + + + + + + + 0 + 0 + 1 + 1 + + + + + True + False + True + 0 + none + + + True + False + True + 6 + 12 + + + True + False + True + 6 + 12 + True + + + True + False + 0 + Level + True + level + + + 0 + 0 + 1 + 1 + + + + + True + False + 0 + Separator + True + chapseparator + + + 0 + 1 + 1 + 1 + + + + + True + True + center + True + + True + + + 1 + 1 + 1 + 1 + + + + + True + False + center + True + 0 + 1 + + None + + + + 1 + 0 + 1 + 1 + + + + + + + + + True + False + Numbering captions by chapter + + + + + + + + 0 + 1 + 1 + 1 + + + + + True + False + True + 0 + none + + + True + False + True + 6 + 12 + + + True + False + True + 6 + 12 + + + True + False + 0 + Character style + True + charstyle + + + 0 + 0 + 1 + 1 + + + + + True + False + 0 + 1 + + None + + + + 1 + 0 + 1 + 1 + + + + + Apply border and shadow + True + True + False + True + 0 + True + + + 0 + 1 + 2 + 1 + + + + + + + + + True + False + Category and frame format + + + + + + + + 0 + 2 + 1 + 1 + + + + + 1 + 0 + 1 + 1 + + + + + True + False + start + 12 + + + True + False + True + 0 + none + + + True + False + True + 6 + 12 + + + True + False + + + + + + + + + + True + False + Add captions automatically +when inserting: + + + + + + + + 0 + 0 + 1 + 1 + + + + + True + False + + + 0 + 2 + 1 + 1 + + + + + True + False + True + 0 + none + + + True + False + True + 6 + 12 + + + True + False + start + 0 + 1 + + Category first + Numbering first + + + + + + + + True + False + Caption order + + + + + + + + 0 + 1 + 1 + 1 + + + + + 0 + 0 + 1 + 1 + + + + + False + True + 0 + + + + + + + + + + + + + + + + -- cgit