Hi,
I have submitted a patch for review:
https://gerrit.libreoffice.org/3337
To pull it, you can do:
git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/37/3337/1
Convert Paragraph Outline&Numbering tab page to Widget UI
Change-Id: I5280ddaa714db0f9ffd61cf400acf9a9fcc1087b
---
M sw/AllLangResTarget_sw.mk
M sw/UI_swriter.mk
M sw/inc/helpid.h
M sw/source/ui/chrdlg/numpara.cxx
D sw/source/ui/chrdlg/numpara.hrc
D sw/source/ui/chrdlg/numpara.src
M sw/source/ui/inc/numpara.hxx
A sw/uiconfig/swriter/ui/numparapage.ui
8 files changed, 534 insertions(+), 360 deletions(-)
diff --git a/sw/AllLangResTarget_sw.mk b/sw/AllLangResTarget_sw.mk
index 1e94fa7..735751a 100644
--- a/sw/AllLangResTarget_sw.mk
+++ b/sw/AllLangResTarget_sw.mk
@@ -76,7 +76,6 @@
sw/source/ui/chrdlg/chardlg.src \
sw/source/ui/chrdlg/chrdlg.src \
sw/source/ui/chrdlg/drpcps.src \
- sw/source/ui/chrdlg/numpara.src \
sw/source/ui/chrdlg/paradlg.src \
sw/source/ui/config/mailconfigpage.src \
sw/source/ui/config/optcomp.src \
diff --git a/sw/UI_swriter.mk b/sw/UI_swriter.mk
index 1ae6c0c..1807eb3 100644
--- a/sw/UI_swriter.mk
+++ b/sw/UI_swriter.mk
@@ -35,6 +35,7 @@
sw/uiconfig/swriter/ui/insertscript \
sw/uiconfig/swriter/ui/inserttable \
sw/uiconfig/swriter/ui/linenumbering \
+ sw/uiconfig/swriter/ui/numparapage \
sw/uiconfig/swriter/ui/opttestpage \
sw/uiconfig/swriter/ui/outlinenumbering \
sw/uiconfig/swriter/ui/outlinenumberingpage \
diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h
index 66574aa..e861eb1 100644
--- a/sw/inc/helpid.h
+++ b/sw/inc/helpid.h
@@ -171,7 +171,7 @@
#define HID_FLD_FUNC "SW_HID_FLD_FUNC"
#define HID_FLD_REF "SW_HID_FLD_REF"
#define HID_OPTSHDWCRSR "SW_HID_OPTSHDWCRSR"
-#define HID_NUMPARA "SW_HID_NUMPARA"
+
#define HID_REDLINE_OPT "SW_HID_REDLINE_OPT"
#define HID_EDIT_FLD_DB "SW_HID_EDIT_FLD_DB"
#define HID_EDIT_FLD_DOKINF "SW_HID_EDIT_FLD_DOKINF"
diff --git a/sw/source/ui/chrdlg/numpara.cxx b/sw/source/ui/chrdlg/numpara.cxx
index 54975d7..e4d13af 100644
--- a/sw/source/ui/chrdlg/numpara.cxx
+++ b/sw/source/ui/chrdlg/numpara.cxx
@@ -30,7 +30,6 @@
#include <svl/intitem.hxx>
#include <fmtline.hxx>
#include <numpara.hxx>
-#include <numpara.hrc>
#include <app.hrc>
@@ -42,54 +41,48 @@
0
};
-SwParagraphNumTabPage::SwParagraphNumTabPage(Window* pParent,
- const SfxItemSet& rAttr ) :
- SfxTabPage(pParent, SW_RES(TP_NUMPARA), rAttr),
- aOutlineStartFL ( this, SW_RES( FL_OUTLINE_START )),
- aOutlineLvFT ( this, SW_RES( FT_OUTLINE_LEVEL )),
- aOutlineLvLB ( this, SW_RES( LB_OUTLINE_LEVEL )),
- aNewStartFL ( this, SW_RES( FL_NEW_START ) ),
- aNumberStyleFT ( this, SW_RES( FT_NUMBER_STYLE ) ),
- aNumberStyleLB ( this, SW_RES( LB_NUMBER_STYLE ) ),
- aNewStartCB ( this, SW_RES( CB_NEW_START ) ),
- aNewStartNumberCB ( this, SW_RES( CB_NUMBER_NEW_START ) ),
- aNewStartNF ( this, SW_RES( NF_NEW_START ) ),
- aCountParaFL ( this, SW_RES( FL_COUNT_PARA ) ),
- aCountParaCB ( this, SW_RES( CB_COUNT_PARA ) ),
- aRestartParaCountCB ( this, SW_RES( CB_RESTART_PARACOUNT ) ),
- aRestartFT ( this, SW_RES( FT_RESTART_NO ) ),
- aRestartNF ( this, SW_RES( NF_RESTART_PARA ) ),
+SwParagraphNumTabPage::SwParagraphNumTabPage(Window* pParent, const SfxItemSet& rAttr ) :
+ SfxTabPage(pParent, "NumParaPage", "/modules/swriter/ui/numparapage.ui", rAttr),
+
msOutlineNumbering( SW_RES( STR_OUTLINE_NUMBERING ) ),
bModified(sal_False),
bCurNumrule(sal_False)
{
- FreeResource();
+ get(m_pOutlineStartBX, "boxOUTLINE");
+ get(m_pOutlineLvLB, "comboLB_OUTLINE_LEVEL");
+
+ get(m_pNumberStyleBX, "boxNUMBER_STYLE");
+ get(m_pNumberStyleLB, "comboLB_NUMBER_STYLE");
+
+ get(m_pNewStartBX, "boxNEW_START");
+ get(m_pNewStartCB, "checkCB_NEW_START");
+ get(m_pNewStartNumberCB, "checkCB_NUMBER_NEW_START");
+ get(m_pNewStartNF, "spinNF_NEW_START");
+
+ get(m_pCountParaFram, "frameFL_COUNT_PARA");
+ get(m_pCountParaCB, "checkCB_COUNT_PARA");
+ get(m_pRestartParaCountCB, "checkCB_RESTART_PARACOUNT");
+
+ get(m_pRestartBX, "boxRESTART_NO");
+ get(m_pRestartNF, "spinNF_RESTART_PARA");
const SfxPoolItem* pItem;
SfxObjectShell* pObjSh;
if(SFX_ITEM_SET == rAttr.GetItemState(SID_HTML_MODE, sal_False, &pItem) ||
( 0 != ( pObjSh = SfxObjectShell::Current()) &&
- 0 != (pItem = pObjSh->GetItem(SID_HTML_MODE))))
+ 0 != (pItem = pObjSh->GetItem(SID_HTML_MODE))))
{
sal_uInt16 nHtmlMode = ((const SfxUInt16Item*)pItem)->GetValue();
+
if(HTMLMODE_ON & nHtmlMode)
- {
- aCountParaFL .Hide();
- aCountParaCB .Hide();
- aRestartParaCountCB .Hide();
- aRestartFT .Hide();
- aRestartNF .Hide();
- }
+ m_pCountParaFram->Hide();
}
- aNewStartCB.SetClickHdl(LINK(this, SwParagraphNumTabPage, NewStartHdl_Impl));
- aNewStartNumberCB.SetClickHdl(LINK(this, SwParagraphNumTabPage, NewStartHdl_Impl));
- aNumberStyleLB.SetSelectHdl(LINK(this, SwParagraphNumTabPage, StyleHdl_Impl));
- aCountParaCB.SetClickHdl(LINK(this,
- SwParagraphNumTabPage, LineCountHdl_Impl));
- aRestartParaCountCB.SetClickHdl(
- LINK(this, SwParagraphNumTabPage, LineCountHdl_Impl));
- aNewStartNF.SetAccessibleName(aNewStartNumberCB.GetText());
- aNewStartNF.SetAccessibleRelationLabeledBy(&aNewStartNumberCB);
+
+ m_pNewStartCB->SetClickHdl(LINK(this, SwParagraphNumTabPage, NewStartHdl_Impl));
+ m_pNewStartNumberCB->SetClickHdl(LINK(this, SwParagraphNumTabPage, NewStartHdl_Impl));
+ m_pNumberStyleLB->SetSelectHdl(LINK(this, SwParagraphNumTabPage, StyleHdl_Impl));
+ m_pCountParaCB->SetClickHdl(LINK(this, SwParagraphNumTabPage, LineCountHdl_Impl));
+ m_pRestartParaCountCB->SetClickHdl( LINK(this, SwParagraphNumTabPage, LineCountHdl_Impl));
}
SwParagraphNumTabPage::~SwParagraphNumTabPage()
@@ -109,9 +102,9 @@
sal_Bool SwParagraphNumTabPage::FillItemSet( SfxItemSet& rSet )
{
- if( aOutlineLvLB.GetSelectEntryPos() != aOutlineLvLB.GetSavedValue())
+ if( m_pOutlineLvLB->GetSelectEntryPos() != m_pOutlineLvLB->GetSavedValue())
{
- sal_uInt16 aOutlineLv = aOutlineLvLB.GetSelectEntryPos();
+ sal_uInt16 aOutlineLv = m_pOutlineLvLB->GetSelectEntryPos();
const SfxUInt16Item* pOldOutlineLv = (const SfxUInt16Item*)GetOldItem( rSet,
SID_ATTR_PARA_OUTLINE_LEVEL);
SfxUInt16Item* pOutlineLv = (SfxUInt16Item*)pOldOutlineLv->Clone();
pOutlineLv->SetValue( aOutlineLv );
@@ -120,11 +113,11 @@
bModified = sal_True;
}
- if( aNumberStyleLB.GetSelectEntryPos() != aNumberStyleLB.GetSavedValue())
+ if( m_pNumberStyleLB->GetSelectEntryPos() != m_pNumberStyleLB->GetSavedValue())
{
- String aStyle;
- if(aNumberStyleLB.GetSelectEntryPos())
- aStyle = aNumberStyleLB.GetSelectEntry();
+ OUString aStyle;
+ if(m_pNumberStyleLB->GetSelectEntryPos())
+ aStyle = m_pNumberStyleLB->GetSelectEntry();
const SfxStringItem* pOldRule = (const SfxStringItem*)GetOldItem( rSet,
SID_ATTR_PARA_NUMRULE);
SfxStringItem* pRule = (SfxStringItem*)pOldRule->Clone();
pRule->SetValue(aStyle);
@@ -132,26 +125,26 @@
delete pRule;
bModified = sal_True;
}
- if(aNewStartCB.GetState() != aNewStartCB.GetSavedValue() ||
- aNewStartNumberCB.GetState() != aNewStartNumberCB.GetSavedValue()||
- aNewStartNF.GetText() != aNewStartNF.GetSavedValue())
+ if(m_pNewStartCB->GetState() != m_pNewStartCB->GetSavedValue() ||
+ m_pNewStartNumberCB->GetState() != m_pNewStartNumberCB->GetSavedValue()||
+ m_pNewStartNF->GetText() != m_pNewStartNF->GetSavedValue())
{
bModified = sal_True;
- sal_Bool bNewStartChecked = STATE_CHECK == aNewStartCB.GetState();
- sal_Bool bNumberNewStartChecked = STATE_CHECK == aNewStartNumberCB.GetState();
+ bool bNewStartChecked = STATE_CHECK == m_pNewStartCB->GetState();
+ bool bNumberNewStartChecked = STATE_CHECK == m_pNewStartNumberCB->GetState();
rSet.Put(SfxBoolItem(FN_NUMBER_NEWSTART, bNewStartChecked));
rSet.Put(SfxUInt16Item(FN_NUMBER_NEWSTART_AT,
- bNumberNewStartChecked && bNewStartChecked ? (sal_uInt16)aNewStartNF.GetValue()
: USHRT_MAX));
+ bNumberNewStartChecked && bNewStartChecked ?
(sal_uInt16)m_pNewStartNF->GetValue() : USHRT_MAX));
}
- if(aCountParaCB.GetSavedValue() != aCountParaCB.GetState() ||
- aRestartParaCountCB.GetSavedValue() != aRestartParaCountCB.GetState() ||
- aRestartNF.GetSavedValue() != aRestartNF.GetText() )
+ if(m_pCountParaCB->GetSavedValue() != m_pCountParaCB->GetState() ||
+ m_pRestartParaCountCB->GetSavedValue() != m_pRestartParaCountCB->GetState() ||
+ m_pRestartNF->GetSavedValue() != m_pRestartNF->GetText() )
{
SwFmtLineNumber aFmt;
- aFmt.SetStartValue( static_cast< sal_uLong >(aRestartParaCountCB.GetState() == STATE_CHECK
?
- aRestartNF.GetValue() : 0 ));
- aFmt.SetCountLines( aCountParaCB.IsChecked() );
+ aFmt.SetStartValue( static_cast< sal_uLong >(m_pRestartParaCountCB->GetState() ==
STATE_CHECK ?
+ m_pRestartNF->GetValue() : 0 ));
+ aFmt.SetCountLines( m_pCountParaCB->IsChecked() );
rSet.Put(aFmt);
bModified = sal_True;
}
@@ -168,141 +161,138 @@
if( eItemState >= SFX_ITEM_AVAILABLE )
{
nOutlineLv = ((const SfxUInt16Item &)rSet.Get( GetWhich(SID_ATTR_PARA_OUTLINE_LEVEL)
)).GetValue();
- aOutlineLvLB.SelectEntryPos( nOutlineLv ) ;
+ m_pOutlineLvLB->SelectEntryPos( nOutlineLv ) ;
}
else
{
- aOutlineLvLB.SetNoSelection();
+ m_pOutlineLvLB->SetNoSelection();
}
- aOutlineLvLB.SaveValue();
+ m_pOutlineLvLB->SaveValue();
eItemState = rSet.GetItemState( GetWhich(SID_ATTR_PARA_NUMRULE) );
- String aStyle;
+ OUString aStyle;
if( eItemState >= SFX_ITEM_AVAILABLE )
{
aStyle = ((const SfxStringItem &)rSet.Get( GetWhich(SID_ATTR_PARA_NUMRULE) )).GetValue();
- if(!aStyle.Len())
- aStyle = aNumberStyleLB.GetEntry(0);
+ if(aStyle.isEmpty())
+ aStyle = m_pNumberStyleLB->GetEntry(0);
- if( aStyle.EqualsAscii("Outline"))
+ if( aStyle == "Outline")
{
- aNumberStyleLB.InsertEntry( msOutlineNumbering );
- aNumberStyleLB.SelectEntry( msOutlineNumbering );
- aNumberStyleLB.RemoveEntry(msOutlineNumbering);
- aNumberStyleLB.SaveValue();
+ m_pNumberStyleLB->InsertEntry( msOutlineNumbering );
+ m_pNumberStyleLB->SelectEntry( msOutlineNumbering );
+ m_pNumberStyleLB->RemoveEntry(msOutlineNumbering);
+ m_pNumberStyleLB->SaveValue();
}
else
- aNumberStyleLB.SelectEntry( aStyle );
+ m_pNumberStyleLB->SelectEntry( aStyle );
bHasNumberStyle = true;
}
else
{
- aNumberStyleLB.SetNoSelection();
+ m_pNumberStyleLB->SetNoSelection();
}
- aNumberStyleLB.SaveValue();
+ m_pNumberStyleLB->SaveValue();
eItemState = rSet.GetItemState( FN_NUMBER_NEWSTART );
if(eItemState > SFX_ITEM_AVAILABLE )
{
bCurNumrule = sal_True;
const SfxBoolItem& rStart = (const SfxBoolItem&)rSet.Get(FN_NUMBER_NEWSTART);
- aNewStartCB.SetState(
- rStart.GetValue() ?
- STATE_CHECK : STATE_NOCHECK );
- aNewStartCB.EnableTriState(sal_False);
+
+ m_pNewStartCB->SetState(rStart.GetValue() ? STATE_CHECK : STATE_NOCHECK );
+
+ m_pNewStartCB->EnableTriState(sal_False);
}
else
- aNewStartCB.SetState(bHasNumberStyle ? STATE_NOCHECK : STATE_DONTKNOW);
- aNewStartCB.SaveValue();
+ m_pNewStartCB->SetState(bHasNumberStyle ? STATE_NOCHECK : STATE_DONTKNOW);
+
+ m_pNewStartCB->SaveValue();
eItemState = rSet.GetItemState( FN_NUMBER_NEWSTART_AT);
if( eItemState > SFX_ITEM_AVAILABLE )
{
sal_uInt16 nNewStart = ((const SfxUInt16Item&)rSet.Get(FN_NUMBER_NEWSTART_AT)).GetValue();
- aNewStartNumberCB.Check(USHRT_MAX != nNewStart);
+ m_pNewStartNumberCB->Check(USHRT_MAX != nNewStart);
if(USHRT_MAX == nNewStart)
nNewStart = 1;
- aNewStartNF.SetValue(nNewStart);
- aNewStartNumberCB.EnableTriState(sal_False);
+ m_pNewStartNF->SetValue(nNewStart);
+ m_pNewStartNumberCB->EnableTriState(sal_False);
}
else
- aNewStartCB.SetState(STATE_DONTKNOW);
- NewStartHdl_Impl(&aNewStartCB);
- aNewStartNF.SaveValue();
- aNewStartNumberCB.SaveValue();
- StyleHdl_Impl(&aNumberStyleLB);
+ m_pNewStartCB->SetState(STATE_DONTKNOW);
+ NewStartHdl_Impl(m_pNewStartCB);
+ m_pNewStartNF->SaveValue();
+ m_pNewStartNumberCB->SaveValue();
+ StyleHdl_Impl(m_pNumberStyleLB);
if( SFX_ITEM_AVAILABLE <= rSet.GetItemState(RES_LINENUMBER))
{
SwFmtLineNumber& rNum = (SwFmtLineNumber&)rSet.Get(RES_LINENUMBER);
sal_uLong nStartValue = rNum.GetStartValue();
- sal_Bool bCount = rNum.IsCount();
- aCountParaCB.SetState( bCount ? STATE_CHECK : STATE_NOCHECK );
- aRestartParaCountCB.SetState( 0 != nStartValue ? STATE_CHECK : STATE_NOCHECK );
- aRestartNF.SetValue(nStartValue == 0 ? 1 : nStartValue);
- LineCountHdl_Impl(&aCountParaCB);
- aCountParaCB.EnableTriState(sal_False);
- aRestartParaCountCB.EnableTriState(sal_False);
+ bool bCount = rNum.IsCount();
+ m_pCountParaCB->SetState( bCount ? STATE_CHECK : STATE_NOCHECK );
+ m_pRestartParaCountCB->SetState( 0 != nStartValue ? STATE_CHECK : STATE_NOCHECK );
+ m_pRestartNF->SetValue(nStartValue == 0 ? 1 : nStartValue);
+ LineCountHdl_Impl(m_pCountParaCB);
+ m_pCountParaCB->EnableTriState(sal_False);
+ m_pRestartParaCountCB->EnableTriState(sal_False);
}
else
{
- aCountParaCB.SetState(STATE_DONTKNOW);
- aRestartParaCountCB.SetState(STATE_DONTKNOW);
+ m_pCountParaCB->SetState(STATE_DONTKNOW);
+ m_pRestartParaCountCB->SetState(STATE_DONTKNOW);
}
- aCountParaCB.SaveValue();
- aRestartParaCountCB.SaveValue();
- aRestartNF.SaveValue();
+ m_pCountParaCB->SaveValue();
+ m_pRestartParaCountCB->SaveValue();
+ m_pRestartNF->SaveValue();
bModified = sal_False;
}
void SwParagraphNumTabPage::DisableOutline()
{
- aOutlineLvFT.Disable();
- aOutlineLvLB.Disable();
+ m_pOutlineStartBX->Disable();
}
void SwParagraphNumTabPage::DisableNumbering()
{
- aNumberStyleFT.Disable();
- aNumberStyleLB.Disable();
+ m_pNumberStyleBX->Disable();
}
void SwParagraphNumTabPage::EnableNewStart()
{
- aNewStartCB.Show();
- aNewStartNumberCB.Show();
- aNewStartNF.Show();
+ m_pNewStartCB->Show();
+ m_pNewStartBX->Show();
}
IMPL_LINK_NOARG(SwParagraphNumTabPage, NewStartHdl_Impl)
{
- sal_Bool bEnable = aNewStartCB.IsChecked();
- aNewStartNumberCB.Enable(bEnable);
- aNewStartNF.Enable(bEnable && aNewStartNumberCB.IsChecked());
+ bool bEnable = m_pNewStartCB->IsChecked();
+ m_pNewStartNumberCB->Enable(bEnable);
+ m_pNewStartNF->Enable(bEnable && m_pNewStartNumberCB->IsChecked());
return 0;
}
IMPL_LINK_NOARG(SwParagraphNumTabPage, LineCountHdl_Impl)
{
- aRestartParaCountCB.Enable(aCountParaCB.IsChecked());
+ m_pRestartParaCountCB->Enable(m_pCountParaCB->IsChecked());
- sal_Bool bEnableRestartValue = aRestartParaCountCB.IsEnabled() &&
- aRestartParaCountCB.IsChecked();
- aRestartFT.Enable(bEnableRestartValue);
- aRestartNF.Enable(bEnableRestartValue);
+ bool bEnableRestartValue = m_pRestartParaCountCB->IsEnabled() &&
+ m_pRestartParaCountCB->IsChecked();
+ m_pRestartBX->Enable(bEnableRestartValue);
return 0;
}
IMPL_LINK( SwParagraphNumTabPage, StyleHdl_Impl, ListBox*, pBox )
{
- sal_Bool bEnable = bCurNumrule || pBox->GetSelectEntryPos() > 0;
- aNewStartCB.Enable(bEnable);
- NewStartHdl_Impl(&aNewStartCB);
+ bool bEnable = bCurNumrule || pBox->GetSelectEntryPos() > 0;
+ m_pNewStartCB->Enable(bEnable);
+ NewStartHdl_Impl(m_pNewStartCB);
return 0;
}
diff --git a/sw/source/ui/chrdlg/numpara.hrc b/sw/source/ui/chrdlg/numpara.hrc
deleted file mode 100644
index d24b2fb..0000000
--- a/sw/source/ui/chrdlg/numpara.hrc
+++ /dev/null
@@ -1,43 +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 .
- */
-
-#ifndef _NUMPARA_HRC
-#define _NUMPARA_HRC
-
-// #define ******************************************************************
-
-#define LB_NUMBER_STYLE 1
-#define FT_NUMBER_STYLE 2
-#define CB_NEW_START 3
-#define CB_NUMBER_NEW_START 4
-#define FL_NEW_START 5
-#define NF_NEW_START 6
-#define FL_COUNT_PARA 7
-#define CB_COUNT_PARA 8
-#define CB_RESTART_PARACOUNT 9
-#define FT_RESTART_NO 10
-#define NF_RESTART_PARA 11
-#define FL_OUTLINE_START 12
-#define LB_OUTLINE_LEVEL 13
-#define FT_OUTLINE_LEVEL 14
-// **********************************************************************
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/chrdlg/numpara.src b/sw/source/ui/chrdlg/numpara.src
deleted file mode 100644
index 545dd86..0000000
--- a/sw/source/ui/chrdlg/numpara.src
+++ /dev/null
@@ -1,187 +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 "numpara.hrc"
-#include "helpid.h"
- // TabPage ******************************************************************
-TabPage TP_NUMPARA
-{
- HelpID = HID_NUMPARA ;
- Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ;
- Hide = TRUE ;
- FixedLine FL_OUTLINE_START
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Outline" ;
- };
- FixedText FT_OUTLINE_LEVEL
- {
- Pos = MAP_APPFONT ( 12 , 16 ) ;
- Size = MAP_APPFONT ( 112 , 8 ) ;
- Text [ en-US ] = "Outline level" ;
- };
- ListBox LB_OUTLINE_LEVEL
- {
- HelpID = "sw:ListBox:TP_NUMPARA:LB_OUTLINE_LEVEL";
- Pos = MAP_APPFONT ( 130 , 14 ) ;
- Size = MAP_APPFONT ( 118 , 65 ) ;
- DropDown = TRUE ;
- Border = TRUE ;
- StringList [ en-US ] =
- {
- < "Body text" ; > ;
- < "Level 1" ; >;
- < "Level 2" ; >;
- < "Level 3" ; >;
- < "Level 4" ; >;
- < "Level 5" ; >;
- < "Level 6" ; >;
- < "Level 7" ; >;
- < "Level 8" ; >;
- < "Level 9" ; >;
- < "Level 10" ; >;
- };
- StringList [ x-comment ] =
- {
- < "Level 0" ; > ;
- < "Level 1" ; >;
- < "Level 2" ; >;
- < "Level 3" ; >;
- < "Level 4" ; >;
- < "Level 5" ; >;
- < "Level 6" ; >;
- < "Level 7" ; >;
- < "Level 8" ; >;
- < "Level 9" ; >;
- < "Level 10" ; >;
- };
- };
- FixedLine FL_NEW_START
- {
- Pos = MAP_APPFONT ( 6 , 32 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Numbering" ;
- };
- FixedText FT_NUMBER_STYLE
- {
- Pos = MAP_APPFONT ( 12 , 43 ) ;
- Size = MAP_APPFONT ( 112 , 8 ) ;
- Text [ en-US ] = "Numbering Style" ;
- };
- ListBox LB_NUMBER_STYLE
- {
- HelpID = "sw:ListBox:TP_NUMPARA:LB_NUMBER_STYLE";
- Pos = MAP_APPFONT ( 130 , 41 ) ;
- Size = MAP_APPFONT ( 118 , 65 ) ;
- DropDown = TRUE ;
- Border = TRUE ;
- StringList [ en-US ] =
- {
- < "None" ; > ;
- };
- };
- TriStateBox CB_NEW_START
- {
- HelpID = "sw:TriStateBox:TP_NUMPARA:CB_NEW_START";
- Pos = MAP_APPFONT ( 12 , 58 ) ;
- Size = MAP_APPFONT ( 160 , 10 ) ;
- Hide = TRUE ;
- TabStop = TRUE ;
- Text [ en-US ] = "R~estart at this paragraph" ;
- };
- TriStateBox CB_NUMBER_NEW_START
- {
- HelpID = "sw:TriStateBox:TP_NUMPARA:CB_NUMBER_NEW_START";
- Pos = MAP_APPFONT ( 21 , 73 ) ;
- Size = MAP_APPFONT ( 103 , 10 ) ;
- Hide = TRUE ;
- Disable = TRUE ;
- Text [ en-US ] = "S~tart with" ;
- };
- NumericField NF_NEW_START
- {
- HelpID = "sw:NumericField:TP_NUMPARA:NF_NEW_START";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 130 , 72 ) ;
- Size = MAP_APPFONT ( 26 , 12 ) ;
- TabStop = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 0 ;
- Maximum = 9999 ;
- Value = 0 ;
- First = 0 ;
- Last = 9999 ;
- Hide = TRUE ;
- Disable = TRUE ;
- };
- FixedLine FL_COUNT_PARA
- {
- Pos = MAP_APPFONT ( 6 , 89 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Line numbering" ;
- };
- TriStateBox CB_COUNT_PARA
- {
- HelpID = "sw:TriStateBox:TP_NUMPARA:CB_COUNT_PARA";
- Pos = MAP_APPFONT ( 12 , 100 ) ;
- Size = MAP_APPFONT ( 160 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Include this paragraph in line numbering" ;
- };
- TriStateBox CB_RESTART_PARACOUNT
- {
- HelpID = "sw:TriStateBox:TP_NUMPARA:CB_RESTART_PARACOUNT";
- Pos = MAP_APPFONT ( 12 , 116 ) ;
- Size = MAP_APPFONT ( 160 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "Rest~art at this paragraph" ;
- };
- FixedText FT_RESTART_NO
- {
- Pos = MAP_APPFONT ( 21 , 132 ) ;
- Size = MAP_APPFONT ( 103 , 8 ) ;
- Disable = TRUE ;
- Text [ en-US ] = "~Start with" ;
- };
- NumericField NF_RESTART_PARA
- {
- HelpID = "sw:NumericField:TP_NUMPARA:NF_RESTART_PARA";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 130 , 130 ) ;
- Size = MAP_APPFONT ( 26 , 12 ) ;
- TabStop = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 1 ;
- Maximum = 65000 ;
- Value = 1 ;
- First = 1 ;
- Last = 65000 ;
- Disable = TRUE ;
- };
-};
- // ********************************************************************** EOF
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/numpara.hxx b/sw/source/ui/inc/numpara.hxx
index 096630e..25d69c2 100644
--- a/sw/source/ui/inc/numpara.hxx
+++ b/sw/source/ui/inc/numpara.hxx
@@ -34,26 +34,26 @@
---------------------------------------------------------------------------*/
class SwParagraphNumTabPage : public SfxTabPage
{
- FixedLine aOutlineStartFL;
- FixedText aOutlineLvFT;
- ListBox aOutlineLvLB;
+ VclHBox* m_pOutlineStartBX;
+ ListBox* m_pOutlineLvLB;
- FixedLine aNewStartFL;
- FixedText aNumberStyleFT;
- ListBox aNumberStyleLB;
+ VclHBox* m_pNumberStyleBX;
+ ListBox* m_pNumberStyleLB;
- TriStateBox aNewStartCB;
- TriStateBox aNewStartNumberCB;
- NumericField aNewStartNF;
+ TriStateBox* m_pNewStartCB;
+ VclHBox* m_pNewStartBX;
+ TriStateBox* m_pNewStartNumberCB;
+ NumericField* m_pNewStartNF;
- FixedLine aCountParaFL;
- TriStateBox aCountParaCB;
- TriStateBox aRestartParaCountCB;
- FixedText aRestartFT;
- NumericField aRestartNF;
+ VclFrame* m_pCountParaFram;
+ TriStateBox* m_pCountParaCB;
+ TriStateBox* m_pRestartParaCountCB;
+
+ VclHBox* m_pRestartBX;
+ NumericField* m_pRestartNF;
// --> OD 2008-04-14 #outlinelevel#
- const String msOutlineNumbering;
+ const OUString msOutlineNumbering;
sal_Bool bModified : 1;
sal_Bool bCurNumrule : 1;
@@ -64,6 +64,7 @@
protected:
SwParagraphNumTabPage(Window* pParent, const SfxItemSet& rSet );
+ void aCountParaFL();
public:
~SwParagraphNumTabPage();
@@ -79,7 +80,7 @@
void DisableOutline();
void DisableNumbering();
- ListBox& GetStyleBox() {return aNumberStyleLB;};
+ ListBox& GetStyleBox() {return *m_pNumberStyleLB;};
};
diff --git a/sw/uiconfig/swriter/ui/numparapage.ui b/sw/uiconfig/swriter/ui/numparapage.ui
new file mode 100644
index 0000000..e7209f1
--- /dev/null
+++ b/sw/uiconfig/swriter/ui/numparapage.ui
@@ -0,0 +1,413 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkAdjustment" id="adjustmentNF_RESTART_PARA">
+ <property name="lower">1</property>
+ <property name="upper">65000</property>
+ <property name="value">1</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
+ <object class="GtkAdjustment" id="adjustmentSTART_WITH">
+ <property name="upper">9999</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
+ <object class="GtkBox" id="NumParaPage">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <child>
+ <object class="GtkFrame" id="frameFL_OUTLINE_START">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="top_padding">6</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkBox" id="boxOUTLINE">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">12</property>
+ <child>
+ <object class="GtkLabel" id="labelFT_OUTLINE_LEVEL">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">Outline level:</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="comboLB_OUTLINE_LEVEL">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="model">liststoreOUTLINE_LEVEL</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="labelOutline">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Outline</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="frameFL_NEW_START">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment" id="alignment2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="top_padding">6</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkBox" id="box2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkBox" id="boxNUMBER_STYLE">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="labelFT_NUMBER_STYLE">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="label" translatable="yes">_Numbering style:</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="comboLB_NUMBER_STYLE">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="model">liststoreNUMBERING</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="checkCB_NEW_START">
+ <property name="label" translatable="yes">R_estart at this paragraph</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="relief">none</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="inconsistent">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="boxNEW_START">
+ <property name="can_focus">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkCheckButton" id="checkCB_NUMBER_NEW_START">
+ <property name="label" translatable="yes">S_tart with:</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="inconsistent">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="spinNF_NEW_START">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">•</property>
+ <property name="invisible_char_set">True</property>
+ <property name="adjustment">adjustmentSTART_WITH</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Numbering</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="frameFL_COUNT_PARA">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment" id="alignment3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="top_padding">6</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkBox" id="box1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkCheckButton" id="checkCB_COUNT_PARA">
+ <property name="label" translatable="yes">_Include this paragraph in line
numbering</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="inconsistent">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="checkCB_RESTART_PARACOUNT">
+ <property name="label" translatable="yes">Rest_art at this paragraph</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="inconsistent">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="boxRESTART_NO">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="labelFT_RESTART_NO">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="margin_left">12</property>
+ <property name="label" translatable="yes">_Start with:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">spinNF_RESTART_PARA</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="spinNF_RESTART_PARA">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">•</property>
+ <property name="invisible_char_set">True</property>
+ <property name="adjustment">adjustmentNF_RESTART_PARA</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="labelLINE_NUMBERING">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Line numbering</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </object>
+ <object class="GtkListStore" id="liststoreNUMBERING">
+ <columns>
+ <!-- column-name gchararray1 -->
+ <column type="gchararray"/>
+ <!-- column-name guint1 -->
+ <column type="guint"/>
+ </columns>
+ <data>
+ <row>
+ <col id="0" translatable="yes">None</col>
+ <col id="1">1</col>
+ </row>
+ </data>
+ </object>
+ <object class="GtkListStore" id="liststoreOUTLINE_LEVEL">
+ <columns>
+ <!-- column-name gchararray1 -->
+ <column type="gchararray"/>
+ <!-- column-name guint1 -->
+ <column type="guint"/>
+ </columns>
+ <data>
+ <row>
+ <col id="0" translatable="yes">Body text</col>
+ <col id="1">0</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">Level 1</col>
+ <col id="1">1</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">Level 2</col>
+ <col id="1">2</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">Level 3</col>
+ <col id="1">3</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">Level 4</col>
+ <col id="1">4</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">Level 5</col>
+ <col id="1">5</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">Level 6</col>
+ <col id="1">6</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">Level 7</col>
+ <col id="1">7</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">Level 8</col>
+ <col id="1">8</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">Level 9</col>
+ <col id="1">9</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">Level 10</col>
+ <col id="1">10</col>
+ </row>
+ </data>
+ </object>
+ <object class="GtkSizeGroup" id="sizegroup1">
+ <widgets>
+ <widget name="comboLB_OUTLINE_LEVEL"/>
+ <widget name="comboLB_NUMBER_STYLE"/>
+ <widget name="spinNF_NEW_START"/>
+ <widget name="spinNF_RESTART_PARA"/>
+ </widgets>
+ </object>
+</interface>
--
To view, visit https://gerrit.libreoffice.org/3337
To unsubscribe, visit https://gerrit.libreoffice.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5280ddaa714db0f9ffd61cf400acf9a9fcc1087b
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Olivier Hallot <olivier.hallot@edx.srv.br>
Context
- [PATCH] Convert Paragraph Outline&Numbering tab page to Widget UI · Olivier Hallot (via Code Review)
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.