summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-08-18 16:16:53 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-08-18 20:23:02 +0100
commit4b42db15708aab7014ec37394ffd51430cdb5f1b (patch)
tree00057bfe1801a4c5e7f6539a4c4c1df66dee38ce /sw
parent81aa4049d1b3109dc792ee3ef06d07ac535dd755 (diff)
convert docinfo field page to .ui
Change-Id: Ic968fdf76f31373240ab70d45192f9716375628b
Diffstat (limited to 'sw')
-rw-r--r--sw/AllLangResTarget_sw.mk1
-rw-r--r--sw/UIConfig_swriter.mk1
-rw-r--r--sw/inc/helpid.h2
-rw-r--r--sw/source/ui/fldui/flddinf.cxx162
-rw-r--r--sw/source/ui/fldui/flddinf.hxx16
-rw-r--r--sw/source/ui/fldui/flddinf.src104
-rw-r--r--sw/source/ui/fldui/fldpage.cxx18
-rw-r--r--sw/source/ui/fldui/fldpage.hxx6
-rw-r--r--sw/source/ui/fldui/fldtdlg.hrc16
-rw-r--r--sw/source/ui/inc/numfmtlb.hxx2
-rw-r--r--sw/source/ui/utlui/numfmtlb.cxx28
-rw-r--r--sw/uiconfig/swriter/ui/flddocinfopage.ui204
12 files changed, 343 insertions, 217 deletions
diff --git a/sw/AllLangResTarget_sw.mk b/sw/AllLangResTarget_sw.mk
index 6317b495198d..2b096dae438a 100644
--- a/sw/AllLangResTarget_sw.mk
+++ b/sw/AllLangResTarget_sw.mk
@@ -102,7 +102,6 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\
sw/source/ui/envelp/labfmt.src \
sw/source/ui/envelp/mailmrge.src \
sw/source/ui/fldui/flddb.src \
- sw/source/ui/fldui/flddinf.src \
sw/source/ui/fldui/flddok.src \
sw/source/ui/fldui/fldfunc.src \
sw/source/ui/fldui/fldref.src \
diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk
index 61f22dcc99cf..2351a3f52664 100644
--- a/sw/UIConfig_swriter.mk
+++ b/sw/UIConfig_swriter.mk
@@ -90,6 +90,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/envformatpage \
sw/uiconfig/swriter/ui/envprinterpage \
sw/uiconfig/swriter/ui/exchangedatabases \
+ sw/uiconfig/swriter/ui/flddocinfopage \
sw/uiconfig/swriter/ui/formatsectiondialog \
sw/uiconfig/swriter/ui/formattablepage \
sw/uiconfig/swriter/ui/footendnotedialog \
diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h
index 01bdcbb4d62a..c08e11c2065c 100644
--- a/sw/inc/helpid.h
+++ b/sw/inc/helpid.h
@@ -145,7 +145,6 @@
#define HID_COND_COLL "SW_HID_COND_COLL"
#define HID_FLD_DB "SW_HID_FLD_DB"
-#define HID_FLD_DOKINF "SW_HID_FLD_DOKINF"
#define HID_FLD_VAR "SW_HID_FLD_VAR"
#define HID_FLD_DOK "SW_HID_FLD_DOK"
#define HID_FLD_FUNC "SW_HID_FLD_FUNC"
@@ -332,7 +331,6 @@
#define HID_COND_COLL_TABLIST "SW_HID_COND_COLL_TABLIST"
#define HID_DB_SELECTION_TLB "SW_HID_DB_SELECTION_TLB"
-#define HID_FIELD_DINF_TYPE "SW_HID_FIELD_DINF_TYPE"
#define HID_SELECT_TEMPLATE "SW_HID_SELECT_TEMPLATE"
diff --git a/sw/source/ui/fldui/flddinf.cxx b/sw/source/ui/fldui/flddinf.cxx
index 68cb2a7b3e2c..a5e7e62b36cf 100644
--- a/sw/source/ui/fldui/flddinf.cxx
+++ b/sw/source/ui/fldui/flddinf.cxx
@@ -48,32 +48,33 @@
using namespace nsSwDocInfoSubType;
using namespace com::sun::star;
-SwFldDokInfPage::SwFldDokInfPage(Window* pWindow, const SfxItemSet& rCoreSet ) :
- SwFldPage( pWindow, SW_RES( TP_FLD_DOKINF ), rCoreSet ),
-
- aTypeFT (this, SW_RES(FT_DOKINFTYPE)),
- aTypeTLB (this, SW_RES(TLB_DOKINFTYPE)),
- aSelectionFT(this, SW_RES(FT_DOKINFSELECTION)),
- aSelectionLB(this, SW_RES(LB_DOKINFSELECTION)),
- aFormatFT (this, SW_RES(FT_DOKINFFORMAT)),
- aFormatLB (this, SW_RES(LB_DOKINFFORMAT)),
- aFixedCB (this, SW_RES(CB_DOKINFFIXEDCONTENT)),
-
- pSelEntry (0),
- aInfoStr (SW_RES(STR_DOKINF_INFO))
+SwFldDokInfPage::SwFldDokInfPage(Window* pParent, const SfxItemSet& rCoreSet)
+ : SwFldPage(pParent, "FldDocInfoPage",
+ "modules/swriter/ui/flddocinfopage.ui", rCoreSet)
+ , pSelEntry(0)
{
- FreeResource();
-
- aTypeTLB.SetHelpId(HID_FIELD_DINF_TYPE);
- aTypeTLB.SetSelectionMode(SINGLE_SELECTION);
- aTypeTLB.SetStyle(aTypeTLB.GetStyle()|WB_HASLINES|WB_CLIPCHILDREN|WB_SORT|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL);
+ get(m_pTypeTLB, "type");
+ get(m_pSelection, "selectframe");
+ get(m_pFormat, "formatframe");
+ get(m_pSelectionLB, "select");
+ get(m_pFormatLB, "format");
+ get(m_pFixedCB, "fixed");
+
+ long nHeight = m_pTypeTLB->GetTextHeight() * 20;
+ m_pTypeTLB->set_height_request(nHeight);
+ m_pSelectionLB->set_height_request(nHeight);
+ m_pFormatLB->set_height_request(nHeight);
+
+ m_pTypeTLB->SetSelectionMode(SINGLE_SELECTION);
+ m_pTypeTLB->SetStyle(m_pTypeTLB->GetStyle()|WB_HASLINES|WB_CLIPCHILDREN|WB_SORT|WB_HASBUTTONS|WB_HASBUTTONSATROOT|WB_HSCROLL);
+ m_pTypeTLB->SetIndent(10);
// Don't set font, so that the control's font is adobted!
// Otherwise at wrong font bug to OV.
- aTypeTLB.SetSpaceBetweenEntries(0);
+ m_pTypeTLB->SetSpaceBetweenEntries(0);
- aTypeTLB.SetNodeDefaultImages();
+ m_pTypeTLB->SetNodeDefaultImages();
//enable 'active' language selection
- aFormatLB.SetShowLanguageControl(sal_True);
+ m_pFormatLB->SetShowLanguageControl(sal_True);
SFX_ITEMSET_ARG( &rCoreSet, pItem, SfxUnoAnyItem, SID_DOCINFO, sal_False );
if ( pItem )
@@ -89,8 +90,8 @@ void SwFldDokInfPage::Reset(const SfxItemSet& )
Init(); // general initialisation
// initialise TypeListBox
- aTypeTLB.SetUpdateMode(sal_False);
- aTypeTLB.Clear();
+ m_pTypeTLB->SetUpdateMode(sal_False);
+ m_pTypeTLB->Clear();
pSelEntry = 0;
// display SubTypes in TypeLB
@@ -108,13 +109,13 @@ void SwFldDokInfPage::Reset(const SfxItemSet& )
{
m_sOldCustomFieldName = static_cast<const SwDocInfoField*>(pCurField)->GetName();
}
- aFormatLB.SetAutomaticLanguage(pCurField->IsAutomaticLanguage());
+ m_pFormatLB->SetAutomaticLanguage(pCurField->IsAutomaticLanguage());
SwWrtShell *pSh = GetWrtShell();
if(pSh)
{
const SvNumberformat* pFormat = pSh->GetNumberFormatter()->GetEntry(pCurField->GetFormat());
if(pFormat)
- aFormatLB.SetLanguage(pFormat->GetLanguage());
+ m_pFormatLB->SetLanguage(pFormat->GetLanguage());
}
}
@@ -141,17 +142,17 @@ void SwFldDokInfPage::Reset(const SfxItemSet& )
if( rProperties.getLength() )
{
- pInfo = aTypeTLB.InsertEntry( String(SW_RES( STR_CUSTOM )) );
+ pInfo = m_pTypeTLB->InsertEntry( String(SW_RES( STR_CUSTOM )) );
pInfo->SetUserData(reinterpret_cast<void*>(USHRT_MAX));
for (sal_Int32 n=0; n < rProperties.getLength(); n++)
{
OUString sEntry = rProperties[n].Name;
- pEntry = aTypeTLB.InsertEntry(sEntry, pInfo);
+ pEntry = m_pTypeTLB->InsertEntry(sEntry, pInfo);
if(m_sOldCustomFieldName.equals( sEntry ))
{
pSelEntry = pEntry;
- aTypeTLB.Expand( pInfo );
+ m_pTypeTLB->Expand( pInfo );
}
pEntry->SetUserData(reinterpret_cast<void*>(i));
}
@@ -162,7 +163,7 @@ void SwFldDokInfPage::Reset(const SfxItemSet& )
{
if (!(IsFldDlgHtmlMode() && (i == DI_EDIT || i == DI_THEMA || i == DI_PRINT)))
{
- pEntry = aTypeTLB.InsertEntry(aLst[i]);
+ pEntry = m_pTypeTLB->InsertEntry(aLst[i]);
pEntry->SetUserData(reinterpret_cast<void*>(i));
}
}
@@ -174,12 +175,12 @@ void SwFldDokInfPage::Reset(const SfxItemSet& )
// select old Pos
if (pSelEntry != 0)
{
- aTypeTLB.Select(pSelEntry);
+ m_pTypeTLB->Select(pSelEntry);
nSubType = (sal_uInt16)(sal_uLong)pSelEntry->GetUserData();
}
- else if ( aTypeTLB.GetEntry(0) )
+ else if ( m_pTypeTLB->GetEntry(0) )
{
- pSelEntry = aTypeTLB.GetEntry(0);
+ pSelEntry = m_pTypeTLB->GetEntry(0);
nSubType = (sal_uInt16)(sal_uLong)pSelEntry->GetUserData();
}
@@ -187,18 +188,18 @@ void SwFldDokInfPage::Reset(const SfxItemSet& )
if ( pSelEntry )
TypeHdl();
- aTypeTLB.SetUpdateMode(sal_True);
- aTypeTLB.SetSelectHdl(LINK(this, SwFldDokInfPage, TypeHdl));
- aTypeTLB.SetDoubleClickHdl(LINK(this, SwFldDokInfPage, InsertHdl));
- aSelectionLB.SetSelectHdl(LINK(this, SwFldDokInfPage, SubTypeHdl));
- aSelectionLB.SetDoubleClickHdl(LINK(this, SwFldDokInfPage, InsertHdl));
- aFormatLB.SetDoubleClickHdl(LINK(this, SwFldDokInfPage, InsertHdl));
+ m_pTypeTLB->SetUpdateMode(sal_True);
+ m_pTypeTLB->SetSelectHdl(LINK(this, SwFldDokInfPage, TypeHdl));
+ m_pTypeTLB->SetDoubleClickHdl(LINK(this, SwFldDokInfPage, InsertHdl));
+ m_pSelectionLB->SetSelectHdl(LINK(this, SwFldDokInfPage, SubTypeHdl));
+ m_pSelectionLB->SetDoubleClickHdl(LINK(this, SwFldDokInfPage, InsertHdl));
+ m_pFormatLB->SetDoubleClickHdl(LINK(this, SwFldDokInfPage, InsertHdl));
if (IsFldEdit())
{
- nOldSel = aSelectionLB.GetSelectEntryPos();
+ nOldSel = m_pSelectionLB->GetSelectEntryPos();
nOldFormat = GetCurField()->GetFormat();
- aFixedCB.SaveValue();
+ m_pFixedCB->SaveValue();
}
}
@@ -208,12 +209,12 @@ IMPL_LINK_NOARG(SwFldDokInfPage, TypeHdl)
SvTreeListEntry* pOldEntry = pSelEntry;
// current ListBoxPos
- pSelEntry = aTypeTLB.FirstSelected();
+ pSelEntry = m_pTypeTLB->FirstSelected();
if(!pSelEntry)
{
- pSelEntry = aTypeTLB.GetEntry(0);
- aTypeTLB.Select(pSelEntry);
+ pSelEntry = m_pTypeTLB->GetEntry(0);
+ m_pTypeTLB->Select(pSelEntry);
}
else if (pOldEntry != pSelEntry)
FillSelectionLB((sal_uInt16)(sal_uLong)pSelEntry->GetUserData());
@@ -226,7 +227,7 @@ IMPL_LINK_NOARG(SwFldDokInfPage, TypeHdl)
IMPL_LINK_NOARG(SwFldDokInfPage, SubTypeHdl)
{
sal_uInt16 nSubType = (sal_uInt16)(sal_uLong)pSelEntry->GetUserData();
- sal_uInt16 nPos = aSelectionLB.GetSelectEntryPos();
+ sal_uInt16 nPos = m_pSelectionLB->GetSelectEntryPos();
sal_uInt16 nExtSubType;
sal_uInt16 nNewType = 0;
@@ -234,15 +235,14 @@ IMPL_LINK_NOARG(SwFldDokInfPage, SubTypeHdl)
{
if (nPos == LISTBOX_ENTRY_NOTFOUND)
{
- if (!aSelectionLB.GetEntryCount())
+ if (!m_pSelectionLB->GetEntryCount())
{
- aFormatLB.Clear();
- aFormatLB.Enable(sal_False);
- aFormatFT.Enable(sal_False);
+ m_pFormatLB->Clear();
+ m_pFormat->Enable(sal_False);
if( nSubType == DI_CUSTOM )
{
//find out which type the custom field has - for a start set to DATE format
- OUString sName = aTypeTLB.GetEntryText(pSelEntry);
+ OUString sName = m_pTypeTLB->GetEntryText(pSelEntry);
try
{
uno::Any aVal = xCustomPropertySet->getPropertyValue( sName );
@@ -270,7 +270,7 @@ IMPL_LINK_NOARG(SwFldDokInfPage, SubTypeHdl)
nPos = 0;
}
- nExtSubType = (sal_uInt16)(sal_uLong)aSelectionLB.GetEntryData(nPos);
+ nExtSubType = (sal_uInt16)(sal_uLong)m_pSelectionLB->GetEntryData(nPos);
}
else
nExtSubType = DI_SUB_TIME;
@@ -279,8 +279,8 @@ IMPL_LINK_NOARG(SwFldDokInfPage, SubTypeHdl)
sal_Bool bEnable = sal_False;
sal_Bool bOneArea = sal_False;
- if (aFormatLB.IsEnabled())
- nOldType = aFormatLB.GetFormatType();
+ if (m_pFormatLB->IsEnabled())
+ nOldType = m_pFormatLB->GetFormatType();
switch (nExtSubType)
{
@@ -299,14 +299,14 @@ IMPL_LINK_NOARG(SwFldDokInfPage, SubTypeHdl)
}
if (!nNewType)
{
- aFormatLB.Clear();
+ m_pFormatLB->Clear();
}
else
{
if (nOldType != nNewType)
{
- aFormatLB.SetFormatType(nNewType);
- aFormatLB.SetOneArea(bOneArea);
+ m_pFormatLB->SetFormatType(nNewType);
+ m_pFormatLB->SetOneArea(bOneArea);
}
bEnable = sal_True;
}
@@ -317,10 +317,10 @@ IMPL_LINK_NOARG(SwFldDokInfPage, SubTypeHdl)
if (IsFldEdit())
{
- nPos = aSelectionLB.GetSelectEntryPos();
+ nPos = m_pSelectionLB->GetSelectEntryPos();
if (nPos != LISTBOX_ENTRY_NOTFOUND )
{
- nSubType = (sal_uInt16)(sal_uLong)aSelectionLB.GetEntryData(nPos);
+ nSubType = (sal_uInt16)(sal_uLong)m_pSelectionLB->GetEntryData(nPos);
nOldSubType &= ~DI_SUB_FIXED;
if (nOldSubType == nSubType)
@@ -331,28 +331,27 @@ IMPL_LINK_NOARG(SwFldDokInfPage, SubTypeHdl)
if(pSh)
{
SvNumberFormatter* pFormatter = pSh->GetNumberFormatter();
- LanguageType eLang = aFormatLB.GetCurLanguage();
+ LanguageType eLang = m_pFormatLB->GetCurLanguage();
if (nNewType == NUMBERFORMAT_DATE)
nFormat = pFormatter->GetFormatIndex( NF_DATE_SYSTEM_SHORT, eLang);
else if (nNewType == NUMBERFORMAT_TIME)
nFormat = pFormatter->GetFormatIndex( NF_TIME_HHMM, eLang);
}
}
- aFormatLB.SetDefFormat(nFormat);
+ m_pFormatLB->SetDefFormat(nFormat);
}
}
else if( (nSubType == DI_CUSTOM) && (nNewType != 0) )
{
- aFormatLB.SetDefFormat(nFormat);
+ m_pFormatLB->SetDefFormat(nFormat);
}
}
- aFormatLB.Enable(bEnable);
- aFormatFT.Enable(bEnable);
+ m_pFormat->Enable(bEnable);
- if (bEnable && aFormatLB.GetSelectEntryPos() == LISTBOX_ENTRY_NOTFOUND)
+ if (bEnable && m_pFormatLB->GetSelectEntryPos() == LISTBOX_ENTRY_NOTFOUND)
{
- aFormatLB.SelectEntryPos(0);
+ m_pFormatLB->SelectEntryPos(0);
}
return 0;
@@ -368,7 +367,7 @@ sal_uInt16 SwFldDokInfPage::FillSelectionLB(sal_uInt16 nSubType)
if (nSubType == USHRT_MAX) // Info-Text
nSubType = DI_SUBTYPE_BEGIN;
- aSelectionLB.Clear();
+ m_pSelectionLB->Clear();
sal_uInt16 nSize = 0;
sal_uInt16 nSelPos = USHRT_MAX;
@@ -376,7 +375,7 @@ sal_uInt16 SwFldDokInfPage::FillSelectionLB(sal_uInt16 nSubType)
if (IsFldEdit())
{
- aFixedCB.Check((nExtSubType & DI_SUB_FIXED) != 0);
+ m_pFixedCB->Check((nExtSubType & DI_SUB_FIXED) != 0);
nExtSubType = ((nExtSubType & ~DI_SUB_FIXED) >> 8) - 1;
}
@@ -389,8 +388,8 @@ sal_uInt16 SwFldDokInfPage::FillSelectionLB(sal_uInt16 nSubType)
nSize = GetFldMgr().GetFormatCount(nTypeId, false, IsFldDlgHtmlMode());
for (sal_uInt16 i = 0; i < nSize; i++)
{
- sal_uInt16 nPos = aSelectionLB.InsertEntry(GetFldMgr().GetFormatStr(nTypeId, i));
- aSelectionLB.SetEntryData(nPos, reinterpret_cast<void*>(GetFldMgr().GetFormatId(nTypeId, i)));
+ sal_uInt16 nPos = m_pSelectionLB->InsertEntry(GetFldMgr().GetFormatStr(nTypeId, i));
+ m_pSelectionLB->SetEntryData(nPos, reinterpret_cast<void*>(GetFldMgr().GetFormatId(nTypeId, i)));
if (IsFldEdit() && i == nExtSubType)
nSelPos = nPos;
}
@@ -400,14 +399,13 @@ sal_uInt16 SwFldDokInfPage::FillSelectionLB(sal_uInt16 nSubType)
if (nSize)
{
- if (!aSelectionLB.GetSelectEntryCount())
- aSelectionLB.SelectEntryPos(nSelPos == USHRT_MAX ? 0 : nSelPos);
+ if (!m_pSelectionLB->GetSelectEntryCount())
+ m_pSelectionLB->SelectEntryPos(nSelPos == USHRT_MAX ? 0 : nSelPos);
bEnable = sal_True;
}
- aSelectionFT.Enable(bEnable);
- aSelectionLB.Enable(bEnable);
+ m_pSelection->Enable(bEnable);
return nSize;
}
@@ -422,28 +420,28 @@ sal_Bool SwFldDokInfPage::FillItemSet(SfxItemSet& )
sal_uLong nFormat = 0;
- sal_uInt16 nPos = aSelectionLB.GetSelectEntryPos();
+ sal_uInt16 nPos = m_pSelectionLB->GetSelectEntryPos();
OUString aName;
if (DI_CUSTOM == nSubType)
- aName = aTypeTLB.GetEntryText(pSelEntry);
+ aName = m_pTypeTLB->GetEntryText(pSelEntry);
if (nPos != LISTBOX_ENTRY_NOTFOUND)
- nSubType |= (sal_uInt16)(sal_uLong)aSelectionLB.GetEntryData(nPos);
+ nSubType |= (sal_uInt16)(sal_uLong)m_pSelectionLB->GetEntryData(nPos);
- if (aFixedCB.IsChecked())
+ if (m_pFixedCB->IsChecked())
nSubType |= DI_SUB_FIXED;
- nPos = aFormatLB.GetSelectEntryPos();
+ nPos = m_pFormatLB->GetSelectEntryPos();
if(nPos != LISTBOX_ENTRY_NOTFOUND)
- nFormat = aFormatLB.GetFormat();
+ nFormat = m_pFormatLB->GetFormat();
- if (!IsFldEdit() || nOldSel != aSelectionLB.GetSelectEntryPos() ||
- nOldFormat != nFormat || aFixedCB.GetState() != aFixedCB.GetSavedValue()
+ if (!IsFldEdit() || nOldSel != m_pSelectionLB->GetSelectEntryPos() ||
+ nOldFormat != nFormat || m_pFixedCB->GetState() != m_pFixedCB->GetSavedValue()
|| (DI_CUSTOM == nSubType && !aName.equals( m_sOldCustomFieldName )))
{
InsertFld(nTypeId, nSubType, aName, aEmptyStr, nFormat,
- ' ', aFormatLB.IsAutomaticLanguage());
+ ' ', m_pFormatLB->IsAutomaticLanguage());
}
return sal_False;
@@ -464,7 +462,7 @@ void SwFldDokInfPage::FillUserData()
{
String sData(OUString(USER_DATA_VERSION));
sData += ';';
- SvTreeListEntry* pEntry = aTypeTLB.FirstSelected();
+ SvTreeListEntry* pEntry = m_pTypeTLB->FirstSelected();
sal_uInt16 nTypeSel = pEntry ? sal::static_int_cast< sal_uInt16 >(reinterpret_cast< sal_uIntPtr >(pEntry->GetUserData())) : USHRT_MAX;
sData += OUString::number( nTypeSel );
SetUserData(sData);
diff --git a/sw/source/ui/fldui/flddinf.hxx b/sw/source/ui/fldui/flddinf.hxx
index 71bcfb1849f5..188c321e3af5 100644
--- a/sw/source/ui/fldui/flddinf.hxx
+++ b/sw/source/ui/fldui/flddinf.hxx
@@ -21,6 +21,7 @@
#include <sfx2/tabdlg.hxx>
#include <vcl/fixed.hxx>
+#include <vcl/layout.hxx>
#include <vcl/lstbox.hxx>
#include <vcl/button.hxx>
#include <vcl/group.hxx>
@@ -35,19 +36,16 @@ namespace com{namespace sun{ namespace star{ namespace beans{
class SwFldDokInfPage : public SwFldPage
{
- FixedText aTypeFT;
- SvTreeListBox aTypeTLB;
- FixedText aSelectionFT;
- ListBox aSelectionLB;
- FixedText aFormatFT;
- NumFormatListBox aFormatLB;
- CheckBox aFixedCB;
+ SvTreeListBox* m_pTypeTLB;
+ VclContainer* m_pSelection;
+ ListBox* m_pSelectionLB;
+ VclContainer* m_pFormat;
+ NumFormatListBox* m_pFormatLB;
+ CheckBox* m_pFixedCB;
SvTreeListEntry* pSelEntry;
com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > xCustomPropertySet;
- String aInfoStr;
-
sal_uInt16 nOldSel;
sal_uLong nOldFormat;
OUString m_sOldCustomFieldName;
diff --git a/sw/source/ui/fldui/flddinf.src b/sw/source/ui/fldui/flddinf.src
deleted file mode 100644
index 98bd9d532d34..000000000000
--- a/sw/source/ui/fldui/flddinf.src
+++ /dev/null
@@ -1,104 +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 "fldtdlg.hrc"
-#include "helpid.h"
-TabPage TP_FLD_DOKINF
-{
- HelpID = HID_FLD_DOKINF ;
- SVLook = TRUE ;
- Hide = TRUE ;
- Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ;
- FixedText FT_DOKINFTYPE
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 76 , 8 ) ;
- Text [ en-US ] = "~Type" ;
- Left = TRUE ;
- };
- Control TLB_DOKINFTYPE
- {
- Border = TRUE ;
- Pos = MAP_APPFONT ( 6 , 16 ) ;
- Size = MAP_APPFONT ( 76 , 163 ) ;
- TabStop = TRUE ;
- };
- FixedText FT_DOKINFSELECTION
- {
- Pos = MAP_APPFONT ( 88 , 3 ) ;
- Size = MAP_APPFONT ( 76 , 8 ) ;
- Text [ en-US ] = "S~elect" ;
- Left = TRUE ;
- };
- ListBox LB_DOKINFSELECTION
- {
- HelpID = "sw:ListBox:TP_FLD_DOKINF:LB_DOKINFSELECTION";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 88 , 16 ) ;
- Size = MAP_APPFONT ( 76 , 163 ) ;
- TabStop = TRUE ;
- StringList [ en-US ] =
- {
- < "Author" ; > ;
- < "Time" ; > ;
- < "Date" ; > ;
- < "Date Time Author" ; > ;
- };
- };
- FixedText FT_DOKINFFORMAT
- {
- Pos = MAP_APPFONT ( 170 , 3 ) ;
- Size = MAP_APPFONT ( 84 , 8 ) ;
- Left = TRUE ;
- Text [ en-US ] = "F~ormat" ;
- };
- ListBox LB_DOKINFFORMAT
- {
- HelpID = "sw:ListBox:TP_FLD_DOKINF:LB_DOKINFFORMAT";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 170 , 16 ) ;
- Size = MAP_APPFONT ( 84 , 148 ) ;
- TabStop = TRUE ;
- AutoHScroll = TRUE ;
- };
- CheckBox CB_DOKINFFIXEDCONTENT
- {
- HelpID = "sw:CheckBox:TP_FLD_DOKINF:CB_DOKINFFIXEDCONTENT";
- Pos = MAP_APPFONT ( 170 , 170 ) ;
- Size = MAP_APPFONT ( 72 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Fixed content" ;
- };
- Bitmap BMP_DOKINFROOT_OPENED
- {
- File = "plus.bmp" ;
- };
- Bitmap BMP_DOKINFROOT_CLOSED
- {
- File = "minus.bmp" ;
- };
- String STR_DOKINF_INFO
- {
- Text [ en-US ] = "Info" ;
- };
- Text [ en-US ] = "DocInformation" ;
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/fldui/fldpage.cxx b/sw/source/ui/fldui/fldpage.cxx
index 6c54aa5434a8..d36c309aaee0 100644
--- a/sw/source/ui/fldui/fldpage.cxx
+++ b/sw/source/ui/fldui/fldpage.cxx
@@ -46,7 +46,6 @@ SwFldPage::SwFldPage( Window *pParent, const ResId &rId,
:SfxTabPage (pParent, rId, rAttrSet),
m_pCurFld (0),
m_pWrtShell (0),
- m_nPageId ( static_cast< sal_uInt16 >(rId.GetId()) ),
m_nTypeSel (LISTBOX_ENTRY_NOTFOUND),
m_nSelectionSel (LISTBOX_ENTRY_NOTFOUND),
m_bFldEdit (false),
@@ -58,6 +57,21 @@ SwFldPage::SwFldPage( Window *pParent, const ResId &rId,
}
+SwFldPage::SwFldPage(Window *pParent, const OString& rID,
+ const OUString& rUIXMLDescription, const SfxItemSet &rAttrSet)
+ : SfxTabPage(pParent, rID, rUIXMLDescription, rAttrSet)
+ , m_pCurFld(0)
+ , m_pWrtShell(0)
+ , m_nTypeSel(LISTBOX_ENTRY_NOTFOUND)
+ , m_nSelectionSel(LISTBOX_ENTRY_NOTFOUND)
+ , m_bFldEdit(false)
+ , m_bInsert(true)
+ , m_bFldDlgHtmlMode(false)
+ , m_bRefresh(false)
+ , m_bFirstHTMLInit(true)
+{
+}
+
SwFldPage::~SwFldPage()
{
}
@@ -354,7 +368,7 @@ void SwFldPage::EnableInsert(sal_Bool bEnable)
if (pDlg)
{
- if (pDlg->GetCurPageId() == m_nPageId)
+ if (pDlg->GetCurTabPage() == this)
pDlg->EnableInsert(bEnable);
}
else
diff --git a/sw/source/ui/fldui/fldpage.hxx b/sw/source/ui/fldui/fldpage.hxx
index 69813f611bf3..40aa937c6d8f 100644
--- a/sw/source/ui/fldui/fldpage.hxx
+++ b/sw/source/ui/fldui/fldpage.hxx
@@ -32,7 +32,6 @@ class SwFldPage : public SfxTabPage
SwFldMgr m_aMgr;
SwField *m_pCurFld;
SwWrtShell* m_pWrtShell;
- sal_uInt16 m_nPageId;
sal_uInt16 m_nTypeSel;
sal_uInt16 m_nSelectionSel;
bool m_bFldEdit;
@@ -80,7 +79,10 @@ public:
const ResId &rId,
const SfxItemSet &rAttrSet );
- virtual ~SwFldPage();
+ SwFldPage(Window *pParent, const OString& rID,
+ const OUString& rUIXMLDescription, const SfxItemSet &rAttrSet);
+
+ virtual ~SwFldPage();
virtual void ActivatePage();
diff --git a/sw/source/ui/fldui/fldtdlg.hrc b/sw/source/ui/fldui/fldtdlg.hrc
index b26318bd257b..55586ff7bd23 100644
--- a/sw/source/ui/fldui/fldtdlg.hrc
+++ b/sw/source/ui/fldui/fldtdlg.hrc
@@ -42,22 +42,8 @@
#define FT_ADDDB (RC_TP_DB_START + 16)
#define PB_ADDDB (RC_TP_DB_START + 17)
-// Documentinfo-TabPage:
-#define RC_TP_DOCINF_START (RC_TP_DB_END)
-#define FT_DOKINFTYPE (RC_TP_DOCINF_START + 1)
-#define TLB_DOKINFTYPE (RC_TP_DOCINF_START + 2)
-#define FT_DOKINFSELECTION (RC_TP_DOCINF_START + 3)
-#define LB_DOKINFSELECTION (RC_TP_DOCINF_START + 4)
-#define FT_DOKINFFORMAT (RC_TP_DOCINF_START + 5)
-#define LB_DOKINFFORMAT (RC_TP_DOCINF_START + 6)
-#define CB_DOKINFFIXEDCONTENT (RC_TP_DOCINF_START + 7)
-#define BMP_DOKINFROOT_OPENED (RC_TP_DOCINF_START + 8)
-#define BMP_DOKINFROOT_CLOSED (RC_TP_DOCINF_START + 9)
-#define STR_DOKINF_INFO (RC_TP_DOCINF_START + 10)
-#define RC_TP_DOCINF_END (RC_TP_DOCINF_START + 11)
-
// Variable-TabPage:
-#define RC_TP_VAR_START (RC_TP_DOCINF_END)
+#define RC_TP_VAR_START (RC_TP_DB_END)
#define FT_VARTYPE (RC_TP_VAR_START + 1)
#define LB_VARTYPE (RC_TP_VAR_START + 2)
#define FT_VARSELECTION (RC_TP_VAR_START + 3)
diff --git a/sw/source/ui/inc/numfmtlb.hxx b/sw/source/ui/inc/numfmtlb.hxx
index d1dafdf12126..28cfd6e4425b 100644
--- a/sw/source/ui/inc/numfmtlb.hxx
+++ b/sw/source/ui/inc/numfmtlb.hxx
@@ -45,6 +45,8 @@ class SW_DLLPUBLIC NumFormatListBox : public ListBox
SW_DLLPRIVATE SwView* GetView();
public:
+ NumFormatListBox(Window* pWin, WinBits nStyle);
+
NumFormatListBox( Window* pWin, const ResId& rResId,
short nFormatType = NUMBERFORMAT_NUMBER, sal_uLong nDefFmt = 0,
sal_Bool bUsrFmts = sal_True );
diff --git a/sw/source/ui/utlui/numfmtlb.cxx b/sw/source/ui/utlui/numfmtlb.cxx
index 58926e6e83fb..f3e8de296bfa 100644
--- a/sw/source/ui/utlui/numfmtlb.cxx
+++ b/sw/source/ui/utlui/numfmtlb.cxx
@@ -70,6 +70,34 @@ NumFormatListBox::NumFormatListBox( Window* pWin, const ResId& rResId,
Init(nFormatType, bUsrFmts);
}
+NumFormatListBox::NumFormatListBox(Window* pWin, WinBits nStyle) :
+ ListBox ( pWin, nStyle ),
+ nCurrFormatType (-1),
+ nStdEntry (0),
+ bOneArea (sal_False),
+ nDefFormat (0),
+ pVw (0),
+ pOwnFormatter (0),
+ bShowLanguageControl(sal_False),
+ bUseAutomaticLanguage(sal_True)
+{
+ Init(NUMBERFORMAT_NUMBER, true);
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeNumFormatListBox(Window *pParent, VclBuilder::stringmap &rMap)
+{
+ WinBits nBits = WB_LEFT|WB_VCENTER|WB_3DLOOK;
+
+ bool bDropdown = VclBuilder::extractDropdown(rMap);
+
+ if (bDropdown)
+ nBits |= WB_DROPDOWN;
+ else
+ nBits |= WB_BORDER;
+
+ return new NumFormatListBox(pParent, nBits|WB_SIMPLEMODE);
+}
+
NumFormatListBox::NumFormatListBox( Window* pWin, SwView* pView,
const ResId& rResId, short nFormatType,
sal_uLong nDefFmt, sal_Bool bUsrFmts ) :
diff --git a/sw/uiconfig/swriter/ui/flddocinfopage.ui b/sw/uiconfig/swriter/ui/flddocinfopage.ui
new file mode 100644
index 000000000000..a6cdd316471b
--- /dev/null
+++ b/sw/uiconfig/swriter/ui/flddocinfopage.ui
@@ -0,0 +1,204 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <!-- interface-requires LibreOffice 1.0 -->
+ <object class="GtkBox" id="FldDocInfoPage">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="spacing">12</property>
+ <property name="homogeneous">True</property>
+ <child>
+ <object class="GtkFrame" id="typeframe">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</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="hexpand">True</property>
+ <property name="top_padding">6</property>
+ <child>
+ <object class="svtlo-SvTreeListBox" id="type:border">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection" id="treeview-selection1"/>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">_Type</property>
+ <property name="use_underline">True</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="selectframe">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</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="hexpand">True</property>
+ <property name="top_padding">6</property>
+ <child>
+ <object class="GtkTreeView" id="select:border">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="model">liststore1</property>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection" id="treeview-selection3"/>
+ </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="xalign">0</property>
+ <property name="label" translatable="yes">S_elect</property>
+ <property name="use_underline">True</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">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="formatframe">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</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="hexpand">True</property>
+ <property name="top_padding">6</property>
+ <child>
+ <object class="GtkBox" id="box1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="swlo-NumFormatListBox" id="format:border">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="dropdown">False</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="fixed">
+ <property name="label" translatable="yes">_Fixed content</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="draw_indicator">True</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="label3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">F_ormat</property>
+ <property name="use_underline">True</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>
+ </object>
+ <object class="GtkListStore" id="liststore1">
+ <columns>
+ <!-- column-name gchararray1 -->
+ <column type="gchararray"/>
+ </columns>
+ <data>
+ <row>
+ <col id="0" translatable="yes">Author</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">Time</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">Date</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">Date Time Author</col>
+ </row>
+ </data>
+ </object>
+ <object class="GtkSizeGroup" id="sizegroup1">
+ <property name="mode">both</property>
+ <widgets>
+ <widget name="type:border"/>
+ <widget name="select:border"/>
+ <widget name="format:border"/>
+ </widgets>
+ </object>
+</interface>