summaryrefslogtreecommitdiff
path: root/sfx2/source/dialog/tabdlg.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2/source/dialog/tabdlg.cxx')
-rw-r--r--sfx2/source/dialog/tabdlg.cxx478
1 files changed, 206 insertions, 272 deletions
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index 35a5fb766b97..c9d90ae59b0b 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,7 +34,7 @@
#include <vcl/msgbox.hxx>
#include <unotools/viewoptions.hxx>
-#define _SVSTDARR_USHORTS
+#define _SVSTDARR_sal_uInt16S
#include <svl/svstdarr.hxx>
#include "appdata.hxx"
@@ -62,7 +63,7 @@
using namespace ::com::sun::star::uno;
using namespace ::rtl;
-#define USERITEM_NAME OUString::createFromAscii( "UserItem" )
+#define USERITEM_NAME OUString(RTL_CONSTASCII_USTRINGPARAM("UserItem"))
TYPEINIT1(LAYOUT_NS_SFX_TABDIALOG SfxTabDialogItem,SfxSetItem);
@@ -79,14 +80,14 @@ NAMESPACE_LAYOUT_SFX_TABDIALOG
struct Data_Impl
{
- sal_uInt16 nId; // Die ID
- CreateTabPage fnCreatePage; // Pointer auf die Factory
- GetTabPageRanges fnGetRanges;// Pointer auf die Ranges-Funktion
- SfxTabPage* pTabPage; // die TabPage selber
+ sal_uInt16 nId; // The ID
+ CreateTabPage fnCreatePage; // Pointer to Factory
+ GetTabPageRanges fnGetRanges; // Pointer to Ranges-Function
+ SfxTabPage* pTabPage; // The TabPage itself
sal_Bool bOnDemand; // Flag: ItemSet onDemand
- sal_Bool bRefresh; // Flag: Seite mu\s neu initialisiert werden
+ sal_Bool bRefresh; // Flag: Page must be re-initialized
- // Konstruktor
+ // Constructor
Data_Impl( sal_uInt16 Id, CreateTabPage fnPage,
GetTabPageRanges fnRanges, sal_Bool bDemand ) :
@@ -119,14 +120,14 @@ SfxTabDialogItem::SfxTabDialogItem( sal_uInt16 nId, const SfxItemSet& rItemSet )
{
}
-SfxPoolItem* __EXPORT SfxTabDialogItem::Clone(SfxItemPool* pToPool) const
+SfxPoolItem* SfxTabDialogItem::Clone(SfxItemPool* pToPool) const
{
return new SfxTabDialogItem( *this, pToPool );
}
-SfxPoolItem* __EXPORT SfxTabDialogItem::Create(SvStream& /*rStream*/, sal_uInt16 /*nVersion*/) const
+SfxPoolItem* SfxTabDialogItem::Create(SvStream& /*rStream*/, sal_uInt16 /*nVersion*/) const
{
- DBG_ERROR( "Use it only in UI!" );
+ OSL_FAIL( "Use it only in UI!" );
return NULL;
}
@@ -255,9 +256,9 @@ void SfxTabPage::SetFrame(const ::com::sun::star::uno::Reference< ::com::sun::st
SfxTabPage::SfxTabPage( Window *pParent,
const ResId &rResId, const SfxItemSet &rAttrSet ) :
-/* [Beschreibung]
+/* [Description]
- Konstruktor
+ Constructor
*/
TabPage( pParent, rResId ),
@@ -282,9 +283,9 @@ SfxTabPage:: SfxTabPage( Window *pParent, WinBits nStyle, const SfxItemSet &rAtt
SfxTabPage::~SfxTabPage()
-/* [Beschreibung]
+/* [Description]
- Destruktor
+ Destructor
*/
{
@@ -312,12 +313,10 @@ void SfxTabPage::Reset( const SfxItemSet& rSet )
void SfxTabPage::ActivatePage( const SfxItemSet& )
-/* [Beschreibung]
-
- Defaultimplementierung der virtuellen ActivatePage-Methode
- Diese wird gerufen, wenn eine Seite des Dialogs den Datenaustausch
- zwischen Pages unterst"utzt.
+/* [Description]
+ Default implementation of the virtual ActivatePage method. This method is
+ called when a page of dialogue supports the exchange of data between pages.
<SfxTabPage::DeactivatePage(SfxItemSet *)>
*/
@@ -328,22 +327,19 @@ void SfxTabPage::ActivatePage( const SfxItemSet& )
int SfxTabPage::DeactivatePage( SfxItemSet* )
-/* [Beschreibung]
+/* [Description]
- Defaultimplementierung der virtuellen DeactivatePage-Methode
- Diese wird vor dem Verlassen einer Seite durch den Sfx gerufen;
- die Anwendung kann "uber den Returnwert steuern,
- ob die Seite verlassen werden soll.
- Falls die Seite "uber bHasExchangeSupport
- anzeigt, da\s sie einen Datenaustausch zwischen Seiten
- unterst"utzt, wird ein Pointer auf das Austausch-Set als
- Parameter "ubergeben. Dieser nimmt die Daten f"ur den Austausch
- entgegen; das Set steht anschlie\send als Parameter in
- <SfxTabPage::ActivatePage(const SfxItemSet &)> zur Verf"ugung.
+ Default implementation of the virtual DeactivatePage method. This method is
+ called by Sfx when leaving a page; the application can, through the return
+ value, control whether to leave the page. If the page is displayed through
+ bHasExchangeSupport which supports data exchange between pages, then a
+ pointer to the exchange set is passed as parameter. This takes on data for
+ the exchange, then the set is available as a parameter in
+ <SfxTabPage::ActivatePage(const SfxItemSet &)>.
- [R"uckgabewert]
+ [Return value]
- LEAVE_PAGE; Verlassen der Seite erlauben
+ LEAVE_PAGE; Allow leaving the page
*/
{
@@ -354,12 +350,11 @@ int SfxTabPage::DeactivatePage( SfxItemSet* )
void SfxTabPage::FillUserData()
-/* [Beschreibung]
+/* [Description]
- virtuelle Methode, wird von der Basisklasse im Destruktor gerufen
- um spezielle Informationen der TabPage in der Ini-Datei zu speichern.
- Beim "Uberladen muss ein String zusammengestellt werden, der mit
- <SetUserData()> dann weggeschrieben wird.
+ Virtual method is called by the base class in the destructor to save
+ specific information of the TabPage in the ini-file. When overloading a
+ string must be compiled, which is then flushed with the <SetUserData()>.
*/
{
@@ -368,11 +363,6 @@ void SfxTabPage::FillUserData()
// -----------------------------------------------------------------------
sal_Bool SfxTabPage::IsReadOnly() const
-
-/* [Description]
-
-*/
-
{
return sal_False;
}
@@ -381,22 +371,17 @@ sal_Bool SfxTabPage::IsReadOnly() const
const SfxPoolItem* SfxTabPage::GetItem( const SfxItemSet& rSet, sal_uInt16 nSlot, sal_Bool bDeep )
-/* [Beschreibung]
-
- static Methode: hiermit wird der Code der TabPage-Implementierungen
- vereinfacht.
+/* [Description]
+ static Method: hereby are the implementations of the TabPage code
+ beeing simplified.
*/
{
const SfxItemPool* pPool = rSet.GetPool();
sal_uInt16 nWh = pPool->GetWhich( nSlot, bDeep );
const SfxPoolItem* pItem = 0;
-#ifdef DEBUG
- SfxItemState eState;
- eState =
-#endif
- rSet.GetItemState( nWh, sal_True, &pItem ); // -Wall required??
+ rSet.GetItemState( nWh, sal_True, &pItem );
if ( !pItem && nWh != nSlot )
pItem = &pPool->GetDefaultItem( nWh );
@@ -408,10 +393,9 @@ const SfxPoolItem* SfxTabPage::GetItem( const SfxItemSet& rSet, sal_uInt16 nSlot
const SfxPoolItem* SfxTabPage::GetOldItem( const SfxItemSet& rSet,
sal_uInt16 nSlot, sal_Bool bDeep )
-/* [Beschreibung]
+/* [Description]
- Diese Methode gibt f"ur Vergleiche den alten Wert eines
- Attributs zur"uck.
+ This method returns an attribute for comparison of the old value.
*/
{
@@ -434,11 +418,10 @@ const SfxPoolItem* SfxTabPage::GetOldItem( const SfxItemSet& rSet,
const SfxPoolItem* SfxTabPage::GetExchangeItem( const SfxItemSet& rSet,
sal_uInt16 nSlot )
-/* [Beschreibung]
+/* [Description]
- Diese Methode gibt f"ur Vergleiche den alten Wert eines
- Attributs zur"uck. Dabei wird ber"ucksichtigt, ob der Dialog
- gerade mit OK beendet wurde.
+ This method returns an attribute for comparison of the old value. This way
+ it will be considered whether the dialogue has just been ended with OK.
*/
{
@@ -448,12 +431,11 @@ const SfxPoolItem* SfxTabPage::GetExchangeItem( const SfxItemSet& rSet,
return GetOldItem( rSet, nSlot );
}
-// add CHINA001 begin
+
void SfxTabPage::PageCreated( SfxAllItemSet /*aSet*/ )
{
DBG_ASSERT(0, "SfxTabPage::PageCreated should not be called");
-}//CHINA001
-// add CHINA001 end
+}
// -----------------------------------------------------------------------
@@ -501,21 +483,21 @@ void SfxTabPage::AddItemConnection( sfx::ItemConnectionBase* pConnection )
SfxTabDialog::SfxTabDialog
-/* [Beschreibung]
+/* [Description]
- Konstruktor
+ Constructor
*/
(
- SfxViewFrame* pViewFrame, // Frame, zu dem der Dialog geh"ort
- Window* pParent, // Parent-Fenster
+ SfxViewFrame* pViewFrame, // Frame, to which the Dialog belongs
+ Window* pParent, // Parent Window
const ResId& rResId, // ResourceId
- const SfxItemSet* pItemSet, // Itemset mit den Daten;
- // kann NULL sein, wenn Pages onDemand
- sal_Bool bEditFmt, // Flag: es werden Vorlagen bearbeitet
- // wenn ja -> zus"atzlicher Button f"ur Standard
- const String* pUserButtonText // Text fuer BenutzerButton;
- // wenn != 0, wird der UserButton erzeugt
+ const SfxItemSet* pItemSet, // Itemset with the data;
+ // can be NULL, when Pages are onDemand
+ sal_Bool bEditFmt, // Flag: templates are processed
+ // when yes -> additional Button for standard
+ const String* pUserButtonText // Text for UserButton;
+ // if != 0, the UserButton is created
) :
TabDialog( pParent, rResId ),
pFrame( pViewFrame ),
@@ -528,45 +510,45 @@ SfxTabDialog::SfxTabDialog
SfxTabDialog::SfxTabDialog
-/* [Beschreibung]
+/* [Description]
- Konstruktor, tempor"ar ohne Frame
+ Constructor, temporary without Frame
*/
(
- Window* pParent, // Parent-Fenster
+ Window* pParent, // Parent Window
const ResId& rResId, // ResourceId
- const SfxItemSet* pItemSet, // Itemset mit den Daten; kann NULL sein,
- // wenn Pages onDemand
- sal_Bool bEditFmt, // Flag: es werden Vorlagen bearbeitet
- // wenn ja -> zus"atzlicher Button f"ur Standard
- const String* pUserButtonText // Text f"ur BenutzerButton;
- // wenn != 0, wird der UserButton erzeugt
+ const SfxItemSet* pItemSet, // Itemset with the data;
+ // can be NULL, when Pages are onDemand
+ sal_Bool bEditFmt, // Flag: templates are processed
+ // when yes -> additional Button for standard
+ const String* pUserButtonText // Text for UserButton;
+ // if != 0, the UserButton is created
) :
TabDialog( pParent, rResId ),
pFrame( 0 ),
INI_LIST(pItemSet)
{
Init_Impl( bFmt, pUserButtonText );
- DBG_WARNING( "bitte den Ctor mit ViewFrame verwenden" );
+ DBG_WARNING( "Please use the Construtor with the ViewFrame" );
}
SfxTabDialog::SfxTabDialog
-/* [Beschreibung]
+/* [Description]
- Konstruktor, tempor"ar ohne Frame
+ Constructor, temporary without Frame
*/
(
- Window* pParent, // Parent-Fenster
+ Window* pParent, // Parent Window
const ResId& rResId, // ResourceId
sal_uInt16 nSetId,
SfxBindings& rBindings,
- sal_Bool bEditFmt, // Flag: es werden Vorlagen bearbeitet
- // wenn ja -> zus"atzlicher Button f"ur Standard
- const String* pUserButtonText // Text f"ur BenutzerButton;
- // wenn != 0, wird der UserButton erzeugt
+ sal_Bool bEditFmt, // Flag: templates are processed
+ // when yes -> additional Button for standard
+ const String* pUserButtonText // Text for UserButton;
+ // if != 0, the UserButton is created
) :
TabDialog( pParent, rResId ),
pFrame( 0 ),
@@ -646,9 +628,9 @@ SfxTabDialog::~SfxTabDialog()
void SfxTabDialog::Init_Impl( sal_Bool bFmtFlag, const String* pUserButtonText )
-/* [Beschreibung]
+/* [Description]
- interne Initialisierung des Dialogs
+ internal initialization of the dialogue
*/
{
@@ -682,10 +664,10 @@ void SfxTabDialog::Init_Impl( sal_Bool bFmtFlag, const String* pUserButtonText )
aBaseFmtBtn.SetClickHdl( LINK( this, SfxTabDialog, BaseFmtHdl ) );
aBaseFmtBtn.SetHelpId( HID_TABDLG_STANDARD_BTN );
- // bFmt = tempor"ares Flag im Ctor() "ubergeben,
- // wenn bFmt == 2, dann auch sal_True,
- // zus"atzlich Ausblendung vom StandardButton,
- // nach der Initialisierung wieder auf sal_True setzen
+ // bFmt = temporary Flag passed on in the Constructor(),
+ // if bFmt == 2, then also sal_True,
+ // additional suppression of the standard button,
+ // after the Initializing set to sal_True again
if ( bFmtFlag != 2 )
aBaseFmtBtn.Show();
else
@@ -843,7 +825,7 @@ void SfxTabDialog::Start_Impl()
SetWindowState( ByteString( aDlgOpt.GetWindowState().getStr(), RTL_TEXTENCODING_ASCII_US ) );
#endif /* !ENABLE_LAYOUT_SFX_TABDIALOG */
- // initiale TabPage aus Programm/Hilfe/Konfig
+ // initial TabPage from Program/Help/config
nActPage = (sal_uInt16)aDlgOpt.GetPageID();
if ( USHRT_MAX != nAppPageId )
@@ -888,20 +870,19 @@ void SfxTabDialog::AddTabPage( sal_uInt16 nId, const Bitmap &rRiderBitmap, sal_B
void SfxTabDialog::AddTabPage
-/* [Beschreibung]
+/* [Description]
- Hinzuf"ugen einer Seite zu dem Dialog.
- Mu\s korrespondieren zu einem entsprechende Eintrag im
- TabControl in der Resource des Dialogs.
+ Adding a page to the dialogue. Must correspond to a entry in the
+ TabControl in the resource of the dialogue.
*/
(
- sal_uInt16 nId, // ID der Seite
- CreateTabPage pCreateFunc, // Pointer auf die Factory-Methode
- GetTabPageRanges pRangesFunc, // Pointer auf die Methode f"ur das
- // Erfragen der Ranges onDemand
- sal_Bool bItemsOnDemand // gibt an, ob das Set dieser Seite beim
- // Erzeugen der Seite erfragt wird
+ sal_uInt16 nId, // Page ID
+ CreateTabPage pCreateFunc, // Pointer to the Factory Method
+ GetTabPageRanges pRangesFunc, // Pointer to the Method for quering
+ // Ranges onDemand
+ sal_Bool bItemsOnDemand // indicates whether the set of this page is
+ // requested when created
)
{
pImpl->pData->Append(
@@ -912,11 +893,10 @@ void SfxTabDialog::AddTabPage
void SfxTabDialog::AddTabPage
-/* [Beschreibung]
+/* [Description]
- Hinzuf"ugen einer Seite zu dem Dialog.
- Der Ridertext wird "ubergeben, die Seite hat keine Entsprechung im
- TabControl in der Resource des Dialogs.
+ Add a page to the dialog. The Rider text is passed on, the page has no
+ counterpart in the TabControl in the resource of the dialogue.
*/
(
@@ -929,7 +909,7 @@ void SfxTabDialog::AddTabPage
)
{
DBG_ASSERT( TAB_PAGE_NOTFOUND == aTabCtrl.GetPagePos( nId ),
- "Doppelte Page-Ids in der Tabpage" );
+ "Double Page-Ids in the Tabpage" );
aTabCtrl.InsertPage( nId, rRiderText, nPos );
pImpl->pData->Append(
new Data_Impl( nId, pCreateFunc, pRangesFunc, bItemsOnDemand ) );
@@ -940,11 +920,10 @@ void SfxTabDialog::AddTabPage
void SfxTabDialog::AddTabPage
-/* [Beschreibung]
+/* [Description]
- Hinzuf"ugen einer Seite zu dem Dialog.
- Die Riderbitmap wird "ubergeben, die Seite hat keine Entsprechung im
- TabControl in der Resource des Dialogs.
+ Add a page to the dialog. The riders bitmap is passed on, the page has no
+ counterpart in the TabControl in the resource of the dialogue.
*/
(
@@ -957,7 +936,7 @@ void SfxTabDialog::AddTabPage
)
{
DBG_ASSERT( TAB_PAGE_NOTFOUND == aTabCtrl.GetPagePos( nId ),
- "Doppelte Page-Ids in der Tabpage" );
+ "Duplicate Page-Ids in the Tabpage" );
aTabCtrl.InsertPage( nId, rRiderBitmap, nPos );
pImpl->pData->Append(
new Data_Impl( nId, pCreateFunc, pRangesFunc, bItemsOnDemand ) );
@@ -968,9 +947,9 @@ void SfxTabDialog::AddTabPage
void SfxTabDialog::RemoveTabPage( sal_uInt16 nId )
-/* [Beschreibung]
+/* [Description]
- L"oschen der TabPage mit der ID nId
+ Delete the TabPage with ID nId
*/
{
@@ -1001,7 +980,7 @@ void SfxTabDialog::RemoveTabPage( sal_uInt16 nId )
}
else
{
- DBG_WARNINGFILE( "TabPage-Id nicht bekannt" );
+ DBG_WARNINGFILE( "TabPage-Id not known" );
}
}
@@ -1009,16 +988,16 @@ void SfxTabDialog::RemoveTabPage( sal_uInt16 nId )
void SfxTabDialog::PageCreated
-/* [Beschreibung]
+/* [Description]
- Defaultimplemetierung der virtuellen Methode.
- Diese wird unmittelbar nach dem Erzeugen einer Seite gerufen.
- Hier kann der Dialog direkt an der TabPage Methoden rufen.
+ Default implemetation of the virtual method. This is called immediately
+ after creating a page. Here the dialogue can call the TabPage Method
+ directly.
*/
(
- sal_uInt16, // Id der erzeugten Seite
- SfxTabPage& // Referenz auf die erzeugte Seite
+ sal_uInt16, // Id of the created page
+ SfxTabPage& // Reference to the created page
)
{
}
@@ -1027,11 +1006,10 @@ void SfxTabDialog::PageCreated
SfxItemSet* SfxTabDialog::GetInputSetImpl()
-/* [Beschreibung]
+/* [Description]
- Abgeleitete Klassen legen ggf. fuer den InputSet neuen Speicher an.
- Dieser mu\s im Destruktor auch wieder freigegeben werden. Dazu mu\s
- diese Methode gerufen werden.
+ Derived classes may create new storage for the InputSet. This has to be
+ released in the Destructor. To do this, this method must be called.
*/
{
@@ -1042,9 +1020,9 @@ SfxItemSet* SfxTabDialog::GetInputSetImpl()
SfxTabPage* SfxTabDialog::GetTabPage( sal_uInt16 nPageId ) const
-/* [Beschreibung]
+/* [Description]
- TabPage mit der "Ubergebenen Id zur"uckgeben.
+ Return TabPage with the specified Id.
*/
{
@@ -1059,11 +1037,6 @@ SfxTabPage* SfxTabDialog::GetTabPage( sal_uInt16 nPageId ) const
// -----------------------------------------------------------------------
sal_Bool SfxTabDialog::IsInOK() const
-
-/* [Beschreibung]
-
-*/
-
{
return pImpl->bInOK;
}
@@ -1072,18 +1045,17 @@ sal_Bool SfxTabDialog::IsInOK() const
short SfxTabDialog::Ok()
-/* [Beschreibung]
+/* [Description]
- Ok-Handler des Dialogs
- Das OutputSet wird erstellt und jede Seite wird mit
- dem bzw. ihrem speziellen OutputSet durch Aufruf der Methode
- <SfxTabPage::FillItemSet(SfxItemSet &)> dazu aufgefordert,
- die vom Benuzter eingestellten Daten in das Set zu tun.
+ Ok handler for the Dialogue.
+ The OutputSet is created and for each page this or the special OutputSet
+ is set by calling the method <SfxTabPage::FillItemSet(SfxItemSet &)>, to
+ insert the entered data by the user into the set.
- [R"uckgabewert]
+ [Return value]
- RET_OK: wenn mindestens eine Seite sal_True als Returnwert von
- FillItemSet geliefert hat, sonst RET_CANCEL.
+ RET_OK: if at least one page has returned from FillItemSet,
+ otherwise RET_CANCEL.
*/
{
@@ -1092,7 +1064,7 @@ short SfxTabDialog::Ok()
if ( !pOutSet )
{
if ( !pExampleSet && pSet )
- pOutSet = pSet->Clone( sal_False ); // ohne Items
+ pOutSet = pSet->Clone( sal_False ); // without Items
else if ( pExampleSet )
pOutSet = new SfxItemSet( *pExampleSet );
}
@@ -1148,14 +1120,14 @@ IMPL_LINK( SfxTabDialog, CancelHdl, Button*, pButton )
SfxItemSet* SfxTabDialog::CreateInputItemSet( sal_uInt16 )
-/* [Beschreibung]
+/* [Description]
- Defaultimplemetierung der virtuellen Methode.
- Diese wird gerufen, wenn Pages ihre Sets onDenamd anlegen
+ Default implemetation of the virtual Method.
+ This is called when pages create their sets onDenamd.
*/
{
- DBG_WARNINGFILE( "CreateInputItemSet nicht implementiert" );
+ DBG_WARNINGFILE( "CreateInputItemSet not implemented" );
return new SfxAllItemSet( SFX_APP()->GetPool() );
}
@@ -1163,15 +1135,15 @@ SfxItemSet* SfxTabDialog::CreateInputItemSet( sal_uInt16 )
const SfxItemSet* SfxTabDialog::GetRefreshedSet()
-/* [Beschreibung]
+/* [Description]
- Defaultimplemetierung der virtuellen Methode.
- Diese wird gerufen, wenn <SfxTabPage::DeactivatePage(SfxItemSet *)>
- <SfxTabPage::REFRESH_SET> liefert.
+ Default implemetation of the virtual Method.
+ This is called, when <SfxTabPage::DeactivatePage(SfxItemSet *)>
+ returns <SfxTabPage::REFRESH_SET>.
*/
{
- DBG_ERRORFILE( "GetRefreshedSet nicht implementiert" );
+ DBG_ERRORFILE( "GetRefreshedSet not implemented" );
return 0;
}
@@ -1179,13 +1151,12 @@ const SfxItemSet* SfxTabDialog::GetRefreshedSet()
IMPL_LINK( SfxTabDialog, OkHdl, Button *, EMPTYARG )
-/* [Beschreibung]
+/* [Description]
- Handler des Ok-Buttons
- Dieser ruft f"ur die aktuelle Seite
- <SfxTabPage::DeactivatePage(SfxItemSet *)>.
- Liefert diese <SfxTabPage::LEAVE_PAGE>, wird <SfxTabDialog::Ok()> gerufen
- und so der Dialog beendet.
+ Handler of the Ok-Buttons
+ This calls the current page <SfxTabPage::DeactivatePage(SfxItemSet *)>.
+ Returns <SfxTabPage::LEAVE_PAGE>, <SfxTabDialog::Ok()> is called
+ anf the Dialog is ended.
*/
{
@@ -1244,13 +1215,12 @@ bool SfxTabDialog::PrepareLeaveCurrentPage()
IMPL_LINK( SfxTabDialog, UserHdl, Button *, EMPTYARG )
-/* [Beschreibung]
+/* [Description]
- Handler des User-Buttons
- Dieser ruft f"ur die aktuelle Seite
- <SfxTabPage::DeactivatePage(SfxItemSet *)>.
- Liefert diese <SfxTabPage::LEAVE_PAGE>, wird <SfxTabDialog::Ok()> gerufen.
- Mit dem Return-Wert von <SfxTabDialog::Ok()> wird dann der Dialog beendet.
+ Handler of the User-Buttons
+ This calls the current page <SfxTabPage::DeactivatePage(SfxItemSet *)>.
+ returns this <SfxTabPage::LEAVE_PAGE> and <SfxTabDialog::Ok()> is called.
+ Then the Dialog is ended with the Return value <SfxTabDialog::Ok()>
*/
{
@@ -1271,22 +1241,21 @@ IMPL_LINK( SfxTabDialog, UserHdl, Button *, EMPTYARG )
IMPL_LINK( SfxTabDialog, ResetHdl, Button *, EMPTYARG )
-/* [Beschreibung]
+/* [Description]
- Handler hinter dem Zur"ucksetzen-Button.
- Die aktuelle Page wird mit ihren initialen Daten
- neu initialisiert; alle Einstellungen, die der Benutzer
- auf dieser Seite get"atigt hat, werden aufgehoben.
+ Handler behind the reset button.
+ The Current Page is new initialized with their initial data, all the
+ settings that the user has made on this page are repealed.
*/
{
const sal_uInt16 nId = aTabCtrl.GetCurPageId();
Data_Impl* pDataObject = Find( *pImpl->pData, nId );
- DBG_ASSERT( pDataObject, "Id nicht bekannt" );
+ DBG_ASSERT( pDataObject, "Id not known" );
if ( pDataObject->bOnDemand )
{
- // CSet auf AIS hat hier Probleme, daher getrennt
+ // CSet on AIS has problems here, thus separated
const SfxItemSet* pItemSet = &pDataObject->pTabPage->GetItemSet();
pDataObject->pTabPage->Reset( *(SfxItemSet*)pItemSet );
}
@@ -1299,18 +1268,17 @@ IMPL_LINK( SfxTabDialog, ResetHdl, Button *, EMPTYARG )
IMPL_LINK( SfxTabDialog, BaseFmtHdl, Button *, EMPTYARG )
-/* [Beschreibung]
+/* [Description]
- Handler hinter dem Standard-Button.
- Dieser Button steht beim Bearbeiten von StyleSheets zur Verf"ugung.
- Alle in dem bearbeiteten StyleSheet eingestellten Attribute
- werden gel"oscht.
+ Handler behind the Standard-Button.
+ This button is available when editing style sheets. All the set attributes
+ in the edited stylesheet are deleted.
*/
{
const sal_uInt16 nId = aTabCtrl.GetCurPageId();
Data_Impl* pDataObject = Find( *pImpl->pData, nId );
- DBG_ASSERT( pDataObject, "Id nicht bekannt" );
+ DBG_ASSERT( pDataObject, "Id not known" );
bFmt = 2;
if ( pDataObject->fnGetRanges )
@@ -1328,23 +1296,23 @@ IMPL_LINK( SfxTabDialog, BaseFmtHdl, Button *, EMPTYARG )
if ( *pTmpRanges == *pU )
{
- // Range mit zwei gleichen Werten -> nur ein Item setzen
+ // Range which two identical values -> only set one Item
sal_uInt16 nWh = pPool->GetWhich( *pTmpRanges );
pExampleSet->ClearItem( nWh );
aTmpSet.ClearItem( nWh );
- // am OutSet mit InvalidateItem,
- // damit die "Anderung wirksam wird
+ // At the Outset of InvalidateItem,
+ // so that the change takes effect
pOutSet->InvalidateItem( nWh );
}
else
{
- // richtiger Range mit mehreren Werten
+ // Correct Range with multiple values
sal_uInt16 nTmp = *pTmpRanges, nTmpEnd = *pU;
- DBG_ASSERT( nTmp <= nTmpEnd, "Range ist falsch sortiert" );
+ DBG_ASSERT( nTmp <= nTmpEnd, "Range is sorted the wrong way" );
if ( nTmp > nTmpEnd )
{
- // wenn wirklich falsch sortiert, dann neu setzen
+ // If really sorted wrongly, then set new
sal_uInt16 nTmp1 = nTmp;
nTmp = nTmpEnd;
nTmpEnd = nTmp1;
@@ -1352,21 +1320,21 @@ IMPL_LINK( SfxTabDialog, BaseFmtHdl, Button *, EMPTYARG )
while ( nTmp <= nTmpEnd )
{
- // "uber den Range iterieren, und die Items setzen
+ // Iterate over the Range and set the Items
sal_uInt16 nWh = pPool->GetWhich( nTmp );
pExampleSet->ClearItem( nWh );
aTmpSet.ClearItem( nWh );
- // am OutSet mit InvalidateItem,
- // damit die "Anderung wirksam wird
+ // At the Outset of InvalidateItem,
+ // so that the change takes effect
pOutSet->InvalidateItem( nWh );
nTmp++;
}
}
- // zum n"achsten Paar gehen
+ // Go to the next pair
pTmpRanges += 2;
}
- // alle Items neu gesetzt -> dann an der aktuellen Page Reset() rufen
- DBG_ASSERT( pDataObject->pTabPage, "die Page ist weg" );
+ // Set all Items as new -> the call the current Page Reset()
+ DBG_ASSERT( pDataObject->pTabPage, "the Page is gone" );
pDataObject->pTabPage->Reset( aTmpSet );
pDataObject->pTabPage->pImpl->mbStandard = sal_True;
}
@@ -1383,29 +1351,27 @@ IMPL_LINK( SfxTabDialog, BaseFmtHdl, Button *, EMPTYARG )
IMPL_LINK( SfxTabDialog, ActivatePageHdl, TabControl *, pTabCtrl )
-/* [Beschreibung]
+/* [Description]
- Handler, der vor dem Umschalten auf eine andere Seite
- durch Starview gerufen wird.
- Existiert die Seite noch nicht, so wird sie erzeugt und
- die virtuelle Methode <SfxTabDialog::PageCreated( sal_uInt16, SfxTabPage &)>
- gerufen. Existiert die Seite bereits, so wird ggf.
- <SfxTabPage::Reset(const SfxItemSet &)> oder
- <SfxTabPage::ActivatePage(const SfxItemSet &)> gerufen.
+ Handler that is called by StarView for switching to a different page.
+ If the page not exist yet then it is created and the virtual Method
+ <SfxTabDialog::PageCreated( sal_uInt16, SfxTabPage &)> is called. If the page
+ exist, then the if possible the <SfxTabPage::Reset(const SfxItemSet &)> or
+ <SfxTabPage::ActivatePage(const SfxItemSet &)> is called.
*/
{
sal_uInt16 const nId = pTabCtrl->GetCurPageId();
- DBG_ASSERT( pImpl->pData->Count(), "keine Pages angemeldet" );
+ DBG_ASSERT( pImpl->pData->Count(), "no Pages registered" );
SFX_APP();
// Tab Page schon da?
SfxTabPage* pTabPage = dynamic_cast<SfxTabPage*> (pTabCtrl->GetTabPage( nId ));
Data_Impl* pDataObject = Find( *pImpl->pData, nId );
- DBG_ASSERT( pDataObject, "Id nicht bekannt" );
+ DBG_ASSERT( pDataObject, "Id not known" );
- // ggf. TabPage erzeugen:
+ // Create TabPage if possible:
if ( !pTabPage )
{
#if ENABLE_LAYOUT_SFX_TABDIALOG
@@ -1459,7 +1425,7 @@ IMPL_LINK( SfxTabDialog, ActivatePageHdl, TabControl *, pTabCtrl )
#endif /* ENABLE_LAYOUT */
Size aCtrlSiz = pTabCtrl->GetTabPageSizePixel();
- // Gr"o/se am TabControl nur dann setzen, wenn < als TabPage
+ // Only set Size on TabControl when < as TabPage
if ( aCtrlSiz.Width() < aSiz.Width() ||
aCtrlSiz.Height() < aSiz.Height() )
{
@@ -1494,11 +1460,11 @@ IMPL_LINK( SfxTabDialog, ActivatePageHdl, TabControl *, pTabCtrl )
IMPL_LINK( SfxTabDialog, DeactivatePageHdl, TabControl *, pTabCtrl )
-/* [Beschreibung]
+/* [Description]
- Handler, der vor dem Verlassen einer Seite durch Starview gerufen wird.
+ Handler that is called by StarView before leaving a page.
- [Querverweise]
+ [Cross-reference]
<SfxTabPage::DeactivatePage(SfxItemSet *)>
*/
@@ -1507,13 +1473,13 @@ IMPL_LINK( SfxTabDialog, DeactivatePageHdl, TabControl *, pTabCtrl )
sal_uInt16 nId = pTabCtrl->GetCurPageId();
SFX_APP();
SfxTabPage *pPage = dynamic_cast<SfxTabPage*> (pTabCtrl->GetTabPage( nId ));
- DBG_ASSERT( pPage, "keine aktive Page" );
+ DBG_ASSERT( pPage, "no active Page" );
#ifdef DBG_UTIL
Data_Impl* pDataObject = Find( *pImpl->pData, pTabCtrl->GetCurPageId() );
- DBG_ASSERT( pDataObject, "keine Datenstruktur zur aktuellen Seite" );
+ DBG_ASSERT( pDataObject, "no Data structur for current page" );
if ( pPage->HasExchangeSupport() && pDataObject->bOnDemand )
{
- DBG_WARNING( "Datenaustausch bei ItemsOnDemand ist nicht gewuenscht!" );
+ DBG_WARNING( "Data exchange in ItemsOnDemand is not desired!" );
}
#endif
@@ -1530,9 +1496,6 @@ IMPL_LINK( SfxTabDialog, DeactivatePageHdl, TabControl *, pTabCtrl )
nRet = pPage->DeactivatePage( &aTmp );
else
nRet = pPage->DeactivatePage( NULL );
-//! else
-//! pPage->FillItemSet( aTmp );
-
if ( ( SfxTabPage::LEAVE_PAGE & nRet ) == SfxTabPage::LEAVE_PAGE &&
aTmp.Count() )
{
@@ -1559,15 +1522,15 @@ IMPL_LINK( SfxTabDialog, DeactivatePageHdl, TabControl *, pTabCtrl )
if ( nRet & SfxTabPage::REFRESH_SET )
{
pSet = GetRefreshedSet();
- DBG_ASSERT( pSet, "GetRefreshedSet() liefert NULL" );
- // alle Pages als neu zu initialsieren flaggen
+ DBG_ASSERT( pSet, "GetRefreshedSet() returns NULL" );
+ // Flag all Pages as to be initialized as new
const sal_uInt16 nCount = pImpl->pData->Count();
for ( sal_uInt16 i = 0; i < nCount; ++i )
{
Data_Impl* pObj = (*pImpl->pData)[i];
- if ( pObj->pTabPage != pPage ) // eigene Page nicht mehr refreshen
+ if ( pObj->pTabPage != pPage ) // Do not refresh own Page anymore
pObj->bRefresh = sal_True;
else
pObj->bRefresh = sal_False;
@@ -1583,11 +1546,11 @@ IMPL_LINK( SfxTabDialog, DeactivatePageHdl, TabControl *, pTabCtrl )
const SfxItemSet* SfxTabDialog::GetOutputItemSet
-/* [Beschreibung]
+/* [Description]
- Liefert die Pages, die ihre Sets onDemand liefern, das OutputItemSet.
+ Return the pages that provide their sets onDemand, the OutputItemSet.
- [Querverweise]
+ [Cross-reference]
<SfxTabDialog::AddTabPage(sal_uInt16, CreateTabPage, GetTabPageRanges, sal_Bool)>
<SfxTabDialog::AddTabPage(sal_uInt16, const String &, CreateTabPage, GetTabPageRanges, sal_Bool, sal_uInt16)>
@@ -1595,12 +1558,11 @@ const SfxItemSet* SfxTabDialog::GetOutputItemSet
*/
(
- sal_uInt16 nId // die Id, unter der die Seite bei AddTabPage()
- // hinzugef"ugt wurde.
+ sal_uInt16 nId // the Id, under which the page was added at AddTabPage().
) const
{
Data_Impl* pDataObject = Find( *pImpl->pData, nId );
- DBG_ASSERT( pDataObject, "TabPage nicht gefunden" );
+ DBG_ASSERT( pDataObject, "TabPage not found" );
if ( pDataObject )
{
@@ -1609,7 +1571,6 @@ const SfxItemSet* SfxTabDialog::GetOutputItemSet
if ( pDataObject->bOnDemand )
return &pDataObject->pTabPage->GetItemSet();
- // else
return pOutSet;
}
return NULL;
@@ -1629,19 +1590,11 @@ int SfxTabDialog::FillOutputItemSet()
// -----------------------------------------------------------------------
-#ifdef WNT
-int __cdecl TabDlgCmpUS_Impl( const void* p1, const void* p2 )
-#else
-#if defined(OS2) && defined(ICC)
-int _Optlink TabDlgCmpUS_Impl( const void* p1, const void* p2 )
-#else
-extern "C" int TabDlgCmpUS_Impl( const void* p1, const void* p2 )
-#endif
-#endif
+extern "C" int SAL_CALL TabDlgCmpUS_Impl( const void* p1, const void* p2 )
-/* [Beschreibung]
+/* [Description]
- Vergleichsfunktion f"ur qsort
+ Comparison function for qsort
*/
{
@@ -1652,9 +1605,9 @@ extern "C" int TabDlgCmpUS_Impl( const void* p1, const void* p2 )
void SfxTabDialog::ShowPage( sal_uInt16 nId )
-/* [Beschreibung]
+/* [Description]
- Es wird die TabPage mit der "ubergebenen Id aktiviert.
+ The TabPage is activated with the specified Id.
*/
{
@@ -1666,29 +1619,28 @@ void SfxTabDialog::ShowPage( sal_uInt16 nId )
const sal_uInt16* SfxTabDialog::GetInputRanges( const SfxItemPool& rPool )
-/* [Beschreibung]
+/* [Description]
+
+ Makes the set over the range of all pages of the dialogue. Pages have the
+ static method for querying their range in AddTabPage, ie deliver their
+ sets onDemand.
- Bildet das Set "uber die Ranges aller Seiten des Dialogs.
- Die Pages m"ussen die statische Methode f"ur das Erfragen ihrer
- Ranges bei AddTabPage angegeben haben, liefern also ihre Sets onDemand.
+ [Return value]
- [Querverweise]
+ Pointer to a null-terminated array of sal_uInt16. This array belongs to the
+ dialog and is deleted when the dialogue is destroy.
+
+ [Cross-reference]
<SfxTabDialog::AddTabPage(sal_uInt16, CreateTabPage, GetTabPageRanges, sal_Bool)>
<SfxTabDialog::AddTabPage(sal_uInt16, const String &, CreateTabPage, GetTabPageRanges, sal_Bool, sal_uInt16)>
<SfxTabDialog::AddTabPage(sal_uInt16, const Bitmap &, CreateTabPage, GetTabPageRanges, sal_Bool, sal_uInt16)>
-
- [R"uckgabewert]
-
- Pointer auf nullterminiertes Array von USHORTs
- Dieses Array geh"ort dem Dialog und wird beim
- Zerst"oren des Dialogs gel"oscht.
*/
{
if ( pSet )
{
- DBG_ERRORFILE( "Set bereits vorhanden!" );
+ DBG_ERRORFILE( "Set already exists!" );
return pSet->GetRanges();
}
@@ -1714,7 +1666,7 @@ const sal_uInt16* SfxTabDialog::GetInputRanges( const SfxItemPool& rPool )
}
}
- //! Doppelte Ids entfernen?
+ //! Remove duplicated Ids?
#ifndef TF_POOLABLE
if ( rPool.HasMap() )
#endif
@@ -1725,30 +1677,11 @@ const sal_uInt16* SfxTabDialog::GetInputRanges( const SfxItemPool& rPool )
aUS[i] = rPool.GetWhich( aUS[i] );
}
- // sortieren
+ // sort
if ( aUS.Count() > 1 )
qsort( (void*)aUS.GetData(),
aUS.Count(), sizeof(sal_uInt16), TabDlgCmpUS_Impl );
- // Ranges erzeugen
- //!! Auskommentiert, da fehlerhaft
- /*
- pRanges = new sal_uInt16[aUS.Count() * 2 + 1];
- int j = 0;
- i = 0;
-
- while ( i < aUS.Count() )
- {
- pRanges[j++] = aUS[i];
- // aufeinanderfolgende Zahlen
- for( ; i < aUS.Count()-1; ++i )
- if ( aUS[i] + 1 != aUS[i+1] )
- break;
- pRanges[j++] = aUS[i++];
- }
- pRanges[j] = 0; // terminierende NULL
- */
-
pRanges = new sal_uInt16[aUS.Count() + 1];
memcpy(pRanges, aUS.GetData(), sizeof(sal_uInt16) * aUS.Count());
pRanges[aUS.Count()] = 0;
@@ -1759,10 +1692,9 @@ const sal_uInt16* SfxTabDialog::GetInputRanges( const SfxItemPool& rPool )
void SfxTabDialog::SetInputSet( const SfxItemSet* pInSet )
-/* [Beschreibung]
+/* [Description]
- Mit dieser Methode kann nachtr"aglich der Input-Set initial oder
- neu gesetzt werden.
+ With this method the Input-Set can subsequently be set initally or re-set.
*/
{
@@ -1801,3 +1733,5 @@ long SfxTabDialog::Notify( NotifyEvent& rNEvt )
}
END_NAMESPACE_LAYOUT_SFX_TABDIALOG
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */