summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorFelix Zhang <fezhang@suse.com>2011-11-02 18:47:32 +0800
committerJan Holesovsky <kendy@suse.cz>2011-11-02 14:30:15 +0100
commit8c4b9f7c6bdecca8ec405272a23c7ca35ca0617e (patch)
treef25030a7de8b1f4fee387354d9ee232f9cb71974 /toolkit
parentf65946944eca8da10d1e54a78eb2537e205e855c (diff)
remove unused methods in layout
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/inc/layout/layout-post.hxx23
-rw-r--r--toolkit/inc/layout/layout-pre.hxx29
-rw-r--r--toolkit/inc/layout/layout.hxx346
-rw-r--r--toolkit/source/layout/vcl/wbutton.cxx447
-rw-r--r--toolkit/source/layout/vcl/wcontainer.cxx135
-rw-r--r--toolkit/source/layout/vcl/wfield.cxx407
-rw-r--r--toolkit/source/layout/vcl/wrapper.cxx405
-rw-r--r--toolkit/workben/controls.cxx272
-rw-r--r--toolkit/workben/layout/.gitignore4
-rw-r--r--toolkit/workben/layout/README43
-rwxr-xr-xtoolkit/workben/layout/TEST11
-rw-r--r--toolkit/workben/layout/adjust.xml44
-rw-r--r--toolkit/workben/layout/align-test.xml30
-rw-r--r--toolkit/workben/layout/align.xml44
-rw-r--r--toolkit/workben/layout/boxtest.xml36
-rw-r--r--toolkit/workben/layout/dialogbuttons-ok.xml49
-rw-r--r--toolkit/workben/layout/dialogbuttons-reset.xml54
-rw-r--r--toolkit/workben/layout/dialogbuttons-save.xml49
-rw-r--r--toolkit/workben/layout/dialogbuttons-yes.xml49
-rw-r--r--toolkit/workben/layout/editor-normal.xml53
-rw-r--r--toolkit/workben/layout/editor.cxx1856
-rw-r--r--toolkit/workben/layout/editor.hxx51
-rw-r--r--toolkit/workben/layout/editor.xml52
-rw-r--r--toolkit/workben/layout/empty.xml26
-rw-r--r--toolkit/workben/layout/flow-container.xml48
-rw-r--r--toolkit/workben/layout/flow.xml17
-rw-r--r--toolkit/workben/layout/insert-sheet.xml57
-rw-r--r--toolkit/workben/layout/interactable-containers.xml49
-rw-r--r--toolkit/workben/layout/layout-flat.xml14
-rw-r--r--toolkit/workben/layout/layout.xml15
-rw-r--r--toolkit/workben/layout/message-box.xml41
-rw-r--r--toolkit/workben/layout/more.xml19
-rw-r--r--toolkit/workben/layout/move-copy-sheet.xml21
-rw-r--r--toolkit/workben/layout/non-interactable-containers.xml41
-rw-r--r--toolkit/workben/layout/number-format.xml65
-rw-r--r--toolkit/workben/layout/numeric.xml10
-rw-r--r--toolkit/workben/layout/ooo-patch7
-rw-r--r--toolkit/workben/layout/paragraph.xml77
-rw-r--r--toolkit/workben/layout/plugin.cxx68
-rw-r--r--toolkit/workben/layout/plugin.hxx59
-rw-r--r--toolkit/workben/layout/plugin.xml29
-rw-r--r--toolkit/workben/layout/radio-groups.xml21
-rw-r--r--toolkit/workben/layout/recover.cxx113
-rw-r--r--toolkit/workben/layout/recover.hxx81
-rw-r--r--toolkit/workben/layout/recover.xml67
-rw-r--r--toolkit/workben/layout/refresh7
-rw-r--r--toolkit/workben/layout/run-s2x6
-rw-r--r--toolkit/workben/layout/scroller.xml32
-rw-r--r--toolkit/workben/layout/sequence.xml13
-rw-r--r--toolkit/workben/layout/shutdown.xml54
-rw-r--r--toolkit/workben/layout/simple-paragraph.cxx183
-rw-r--r--toolkit/workben/layout/simple-paragraph.hxx55
-rw-r--r--toolkit/workben/layout/simple-paragraph.xml11
-rw-r--r--toolkit/workben/layout/sort-options.xml40
-rw-r--r--toolkit/workben/layout/sortdlg.cxx72
-rw-r--r--toolkit/workben/layout/sortdlg.hrc71
-rw-r--r--toolkit/workben/layout/sortdlg.hxx76
-rw-r--r--toolkit/workben/layout/sortdlg.src331
-rw-r--r--toolkit/workben/layout/sortdlg.xml65
-rw-r--r--toolkit/workben/layout/splitter.xml13
-rw-r--r--toolkit/workben/layout/string-input.xml16
-rw-r--r--toolkit/workben/layout/tab-dialog.xml20
-rw-r--r--toolkit/workben/layout/tabcontrol.xml18
-rw-r--r--toolkit/workben/layout/table.xml15
-rw-r--r--toolkit/workben/layout/test.cxx369
-rw-r--r--toolkit/workben/layout/test.xml12
-rw-r--r--toolkit/workben/layout/testrc.in8
-rw-r--r--toolkit/workben/layout/tpsort.cxx1107
-rw-r--r--toolkit/workben/layout/tpsort.hxx219
-rw-r--r--toolkit/workben/layout/un-test.sh14
-rw-r--r--toolkit/workben/layout/uno.hxx109
-rw-r--r--toolkit/workben/layout/wordcount-plain.xml37
-rw-r--r--toolkit/workben/layout/wordcount-tight.xml43
-rw-r--r--toolkit/workben/layout/wordcount.xml59
-rw-r--r--toolkit/workben/layout/wordcountdialog.cxx111
-rw-r--r--toolkit/workben/layout/wordcountdialog.hxx70
-rw-r--r--toolkit/workben/layout/zoom-1.xml38
-rw-r--r--toolkit/workben/layout/zoom-2.xml39
-rw-r--r--toolkit/workben/layout/zoom-indent.xml41
-rw-r--r--toolkit/workben/layout/zoom-plain.xml20
-rw-r--r--toolkit/workben/layout/zoom.cxx614
-rw-r--r--toolkit/workben/layout/zoom.hrc53
-rw-r--r--toolkit/workben/layout/zoom.hxx121
-rw-r--r--toolkit/workben/layout/zoom.xml60
-rw-r--r--toolkit/workben/layout/zoom_def.hxx38
-rw-r--r--toolkit/workben/no_localization1
-rw-r--r--toolkit/workben/unodialog.cxx270
87 files changed, 60 insertions, 9925 deletions
diff --git a/toolkit/inc/layout/layout-post.hxx b/toolkit/inc/layout/layout-post.hxx
index 46d4c383a984..da9a052e1b6b 100644
--- a/toolkit/inc/layout/layout-post.hxx
+++ b/toolkit/inc/layout/layout-post.hxx
@@ -35,45 +35,24 @@
#undef _LAYOUT_PRE_HXX
-#undef AdvancedButton
-#undef ApplyButton
#undef Box
#undef Button
#undef CancelButton
-#undef CheckBox
-#undef ComboBox
#undef Container
#undef Control
#undef Dialog
#undef Edit
-#undef ErrorBox
#undef FixedImage
-#undef FixedInfo
-#undef FixedLine
#undef FixedText
-#undef HBox
#undef HelpButton
#undef IgnoreButton
-#undef ImageButton
-#undef InfoBox
#undef ListBox
#undef MessBox
#undef MessageBox
-#undef MetricField
#undef MetricFormatter
-#undef MoreButton
-#undef MultiLineEdit
-#undef MultiListBox
#undef NoButton
-#undef NumericField
#undef NumericFormatter
-#undef OKButton
-#undef Plugin
-#undef ProgressBar
#undef PushButton
-#undef QueryBox
-#undef RadioButton
-#undef ResetButton
#undef RetryButton
#undef SfxTabDialog
#undef SfxTabPage
@@ -84,8 +63,6 @@
#undef TabControl
#undef TabPage
#undef Table
-#undef VBox
-#undef WarningBox
#undef YesButton
#undef SvxFontListBox
diff --git a/toolkit/inc/layout/layout-pre.hxx b/toolkit/inc/layout/layout-pre.hxx
index 4205a44f1f54..9f6b59e3ab2f 100644
--- a/toolkit/inc/layout/layout-pre.hxx
+++ b/toolkit/inc/layout/layout-pre.hxx
@@ -34,57 +34,32 @@
///* Allow re-inclusion for next hxx file. */
#undef _LAYOUT_POST_HXX
-#define AdvancedButton layout::AdvancedButton
-#define ApplyButton layout::ApplyButton
#define Box layout::Box
#define Button layout::Button
#define CancelButton layout::CancelButton
-#define CheckBox layout::CheckBox
-#define ComboBox layout::ComboBox
#define Container layout::Container
#define Control layout::Control
#define Dialog layout::Dialog
#define Edit layout::Edit
-#define ErrorBox layout::ErrorBox
#define FixedImage layout::FixedImage
-#define FixedInfo layout::FixedInfo
-#define FixedLine layout::FixedLine
#define FixedText layout::FixedText
-#define HBox layout::HBox
#define HelpButton layout::HelpButton
#define IgnoreButton layout::IgnoreButton
-#define ImageButton layout::ImageButton
-#define InfoBox layout::InfoBox
-#define LocalizedString layout::LocalizedString
#define ListBox layout::ListBox
#define MessBox layout::MessBox
#define MessageBox layout::MessageBox
-#define MetricField layout::MetricField
#define MetricFormatter layout::MetricFormatter
-#define MoreButton layout::MoreButton
-#define MultiLineEdit layout::MultiLineEdit
-#define MultiListBox layout::MultiListBox
#define NoButton layout::NoButton
-#define NumericField layout::NumericField
#define NumericFormatter layout::NumericFormatter
-#define OKButton layout::OKButton
-#define Plugin layout::Plugin
-#define ProgressBar layout::ProgressBar
#define PushButton layout::PushButton
-#define QueryBox layout::QueryBox
-#define RadioButton layout::RadioButton
-#define ResetButton layout::ResetButton
#define RetryButton layout::RetryButton
#define SfxTabDialog layout::SfxTabDialog
#define SfxTabPage layout::SfxTabPage
#define SvxFontListBox layout::SvxFontListBox
#define SvxLanguageBox layout::SvxLanguageBox
-#define SpinField layout::SpinField
#define TabControl layout::TabControl
#define TabPage layout::TabPage
#define Table layout::Table
-#define VBox layout::VBox
-#define WarningBox layout::WarningBox
#define YesButton layout::YesButton
#define ModalDialog Dialog
@@ -97,12 +72,10 @@
#define Window ::Window
-#else
+#endif /* ENABLE_LAYOUT */
#define LocalizedString String
-#endif /* ENABLE_LAYOUT */
-
#endif /* _LAYOUT_PRE_HXX */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/layout/layout.hxx b/toolkit/inc/layout/layout.hxx
index de53a4687ddb..e2f8d76d032c 100644
--- a/toolkit/inc/layout/layout.hxx
+++ b/toolkit/inc/layout/layout.hxx
@@ -38,13 +38,11 @@
#include <tools/link.hxx>
#include <tools/string.hxx>
#include <vcl/bitmap.hxx>
-#include <vcl/combobox.h>
#include <tools/fldunit.hxx>
#include <vcl/lstbox.h>
#include <tools/wintypes.hxx>
class Button;
-class ComboBox;
class Color;
class Control;
class Dialog;
@@ -53,16 +51,12 @@ class Font;
class Image;
class ListBox;
class MapMode;
-class MultiListBox;
-class NotifyEvent;
class Pointer;
class PushButton;
-class RadioButton;
class ResId;
struct SfxChildWinInfo;
class TabControl;
class TabPage;
-class VCLXRadioButton;
class VCLXWindow;
class Window;
@@ -89,8 +83,6 @@ public:
Context( char const* pPath );
virtual ~Context();
PeerHandle GetPeerHandle( char const* id, sal_uInt32 nId = 0 ) const;
- void setToplevel( PeerHandle xToplevel );
- PeerHandle getToplevel();
PeerHandle getRoot();
};
@@ -195,28 +187,16 @@ class TOOLKIT_DLLPUBLIC Control : public Window
public:
~Control ();
void SetGetFocusHdl (Link const& link);
- Link& GetGetFocusHdl ();
void SetLoseFocusHdl (Link const& link);
- Link& GetLoseFocusHdl ();
-};
-
-class FixedLineImpl;
-class TOOLKIT_DLLPUBLIC FixedLine : public Control
-{
- DECL_GET_IMPL( FixedLine );
- DECL_CONSTRUCTORS( FixedLine, Control, WB_HORZ );
-
-public:
- bool IsEnabled() const;
};
class FixedTextImpl;
class TOOLKIT_DLLPUBLIC FixedText : public Control
{
DECL_GET_IMPL( FixedText );
- DECL_CONSTRUCTORS( FixedText, Control, 0 );
public:
+ FixedText( Context *context, char const* id, sal_uInt32 nId = 0 );
~FixedText ();
void SetText( rtl::OUString const& rStr );
};
@@ -225,16 +205,9 @@ class FixedImageImpl;
class TOOLKIT_DLLPUBLIC FixedImage : public Control
{
DECL_GET_IMPL( FixedImage );
- DECL_CONSTRUCTORS( FixedImage, Control, 0 );
-public:
- void setImage( ::Image const& );
-};
-class FixedInfoImpl;
-class TOOLKIT_DLLPUBLIC FixedInfo : public FixedText
-{
- DECL_GET_IMPL( FixedInfo );
- DECL_CONSTRUCTORS( FixedInfo, FixedText, 0 );
+public:
+ FixedImage( Context *context, char const* id, sal_uInt32 nId = 0 );
};
class ImageImpl;
@@ -242,8 +215,6 @@ class TOOLKIT_DLLPUBLIC Image
{
ImageImpl *pImpl;
public:
- Image( char const* pName );
- ~Image();
ImageImpl &getImpl() const { return *pImpl; }
};
@@ -258,133 +229,55 @@ public:
~Button ();
static String GetStandardText (sal_uInt16 button_type);
void SetText( rtl::OUString const& rStr );
- bool SetModeImage (Image const& image);
- bool SetModeImage (::Image const& image);
- void SetImageAlign( ImageAlign eAlign );
- void SetClickHdl( Link const& rLink );
virtual void Click() /* pure virtual? */;
- Link& GetClickHdl ();
};
class PushButtonImpl;
class TOOLKIT_DLLPUBLIC PushButton : public Button
{
DECL_GET_IMPL( PushButton );
- DECL_CONSTRUCTORS( PushButton, Button, 0 );
DECL_GET_WINDOW (PushButton);
+protected:
+ explicit PushButton( WindowImpl *pImpl ) : Button( pImpl ) {}
+
public:
~PushButton ();
void Check( bool bCheck=true );
- bool IsChecked() const;
- void Toggle();
void SetToggleHdl( Link const& rLink );
};
-class TOOLKIT_DLLPUBLIC OKButton : public PushButton
-{
- DECL_CONSTRUCTORS( OKButton, PushButton, WB_DEFBUTTON );
-};
class TOOLKIT_DLLPUBLIC CancelButton : public PushButton
{
- DECL_CONSTRUCTORS( CancelButton, PushButton, 0 );
+public:
+ CancelButton( Context *context, char const* id, sal_uInt32 nId = 0 );
};
class TOOLKIT_DLLPUBLIC YesButton : public PushButton
{
- DECL_CONSTRUCTORS( YesButton, PushButton, WB_DEFBUTTON );
+public:
+ YesButton( Context *context, char const* id, sal_uInt32 nId = 0 );
};
class TOOLKIT_DLLPUBLIC NoButton : public PushButton
{
- DECL_CONSTRUCTORS( NoButton, PushButton, 0 );
+public:
+ NoButton( Context *context, char const* id, sal_uInt32 nId = 0 );
};
class TOOLKIT_DLLPUBLIC RetryButton : public PushButton
{
- DECL_CONSTRUCTORS( RetryButton, PushButton, 0 );
+public:
+ RetryButton( Context *context, char const* id, sal_uInt32 nId = 0 );
};
class TOOLKIT_DLLPUBLIC IgnoreButton : public PushButton
{
- DECL_CONSTRUCTORS( IgnoreButton, PushButton, 0 );
-};
-class TOOLKIT_DLLPUBLIC ResetButton : public PushButton
-{
- DECL_CONSTRUCTORS( ResetButton, PushButton, 0 );
-};
-class TOOLKIT_DLLPUBLIC ApplyButton : public PushButton
-{
- DECL_CONSTRUCTORS( ApplyButton, PushButton, 0 );
-};
-class TOOLKIT_DLLPUBLIC HelpButton : public PushButton
-{
- DECL_CONSTRUCTORS( HelpButton, PushButton, 0 );
-};
-class TOOLKIT_DLLPUBLIC ImageButton : public PushButton
-{
- DECL_CONSTRUCTORS( ImageButton, PushButton, 0 );
-};
-
-class AdvancedButtonImpl;
-class TOOLKIT_DLLPUBLIC AdvancedButton : public PushButton
-{
- DECL_CONSTRUCTORS( AdvancedButton, PushButton, 0 );
- DECL_GET_IMPL( AdvancedButton );
-
- void AddAdvanced( Window* w );
- void AddSimple( Window* w );
- void RemoveAdvanced( Window* w );
- void RemoveSimple( Window* w );
-
- void SetAdvancedText (rtl::OUString const& text);
- void SetSimpleText (rtl::OUString const& text);
- rtl::OUString GetAdvancedText () const;
- rtl::OUString GetSimpleText () const;
- void SetDelta (int);
-};
-
-class MoreButtonImpl;
-class TOOLKIT_DLLPUBLIC MoreButton : public AdvancedButton
-{
- DECL_CONSTRUCTORS( MoreButton, AdvancedButton, 0 );
- DECL_GET_IMPL( MoreButton );
- void AddWindow( Window* w );
- void RemoveWindow( Window* w );
-
- void SetMoreText (rtl::OUString const& text);
- void SetLessText (rtl::OUString const& text);
- rtl::OUString GetMoreText () const;
- rtl::OUString GetLessText () const;
-};
-
-class RadioButtonImpl;
-class TOOLKIT_DLLPUBLIC RadioButton : public Button
-{
- DECL_GET_IMPL( RadioButton );
- DECL_CONSTRUCTORS( RadioButton, Button, 0 );
- DECL_GET_WINDOW( RadioButton );
- DECL_GET_VCLXWINDOW( RadioButton );
public:
- ~RadioButton ();
- void Check( bool bCheck=true );
- bool IsChecked() const;
-
- void Toggle();
- void SetToggleHdl( Link const& rLink );
+ IgnoreButton( Context *context, char const* id, sal_uInt32 nId = 0 );
};
-
-class CheckBoxImpl;
-class TOOLKIT_DLLPUBLIC CheckBox : public Button
+class TOOLKIT_DLLPUBLIC HelpButton : public PushButton
{
- DECL_GET_IMPL( CheckBox );
- DECL_CONSTRUCTORS( CheckBox, Button, 0 );
-
public:
- ~CheckBox ();
- void Check( bool bCheck=true );
- bool IsChecked() const;
-
- void Toggle();
- void SetToggleHdl( Link const& rLink );
+ HelpButton( Context *context, char const* id, sal_uInt32 nId = 0 );
};
class EditImpl;
@@ -396,24 +289,7 @@ class TOOLKIT_DLLPUBLIC Edit : public Control
public:
~Edit ();
- void SetText( rtl::OUString const& rStr );
- String GetText() const;
void SetModifyHdl( Link const& rLink );
- void SetSelection( Selection const& rSelection );
-};
-
-class MultiLineEditImpl;
-class TOOLKIT_DLLPUBLIC MultiLineEdit : public Edit
-{
- DECL_GET_IMPL( MultiLineEdit );
- DECL_CONSTRUCTORS( MultiLineEdit, Edit, WB_LEFT|WB_BORDER );
-};
-
-class SpinFieldImpl;
-class TOOLKIT_DLLPUBLIC SpinField : public Edit
-{
- DECL_GET_IMPL( SpinField );
- DECL_CONSTRUCTORS( SpinField, Edit, 0 );
};
class FormatterBaseImpl;
@@ -430,24 +306,6 @@ class TOOLKIT_DLLPUBLIC NumericFormatter : public FormatterBase
protected:
explicit NumericFormatter( FormatterBaseImpl *pImpl );
NumericFormatterImpl &getFormatImpl() const;
-public:
- void SetMin( sal_Int64 nNewMin );
- void SetMax( sal_Int64 nNewMax );
- void SetFirst( sal_Int64 nNewFirst );
- void SetLast( sal_Int64 nNewLast );
- void SetSpinSize( sal_Int64 nNewSize );
-
- void SetValue( sal_Int64 nNewValue );
- sal_Int64 GetValue() const;
-};
-
-class NumericFieldImpl;
-class TOOLKIT_DLLPUBLIC NumericField : public SpinField, public NumericFormatter
-{
- DECL_GET_IMPL( NumericField );
-public:
- NumericField( Context *context, char const* id, sal_uInt32 nId=0 );
- NumericField( Window *parent, WinBits nStyle );
};
class MetricFormatterImpl;
@@ -457,47 +315,6 @@ class TOOLKIT_DLLPUBLIC MetricFormatter : public FormatterBase
protected:
explicit MetricFormatter( FormatterBaseImpl *pImpl );
MetricFormatterImpl &getFormatImpl() const;
-public:
- void SetMin( sal_Int64 nNewMin, FieldUnit nUnit=FUNIT_NONE );
- void SetMax( sal_Int64 nNewMax, FieldUnit nUnit=FUNIT_NONE );
- void SetFirst( sal_Int64 nNewFirst, FieldUnit nUnit=FUNIT_NONE );
- void SetLast( sal_Int64 nNewLast, FieldUnit nUnit=FUNIT_NONE );
- void SetValue( sal_Int64 nNewValue, FieldUnit nUnit=FUNIT_NONE );
- sal_Int64 GetValue( FieldUnit nUnit=FUNIT_NONE ) const;
-
- void SetSpinSize( sal_Int64 nNewSize );
-};
-
-class MetricFieldImpl;
-class TOOLKIT_DLLPUBLIC MetricField : public SpinField, public MetricFormatter
-{
- DECL_GET_IMPL( MetricField );
-public:
- MetricField( Context *context, char const* id, sal_uInt32 nId=0 );
- MetricField( Window *parent, WinBits nStyle );
-};
-
-class ComboBoxImpl;
-class TOOLKIT_DLLPUBLIC ComboBox : public Edit
-{
- DECL_GET_IMPL( ComboBox );
- DECL_GET_WINDOW (ComboBox );
- DECL_CONSTRUCTORS( ComboBox, Edit, 0 );
-
-public:
- ~ComboBox ();
- sal_uInt16 InsertEntry( String const& rStr, sal_uInt16 nPos=COMBOBOX_APPEND );
- void RemoveEntry( String const& rStr );
- void RemoveEntry( sal_uInt16 nPos );
- void Clear();
-
- sal_uInt16 GetEntryPos( String const& rStr ) const;
- String GetEntry( sal_uInt16 nPos ) const;
- sal_uInt16 GetEntryCount() const;
-
- void SetClickHdl( Link const& rLink );
- void SetSelectHdl( Link const& rLink );
- void EnableAutocomplete (bool enable, bool matchCase=false );
};
class ListBoxImpl;
@@ -509,46 +326,17 @@ class TOOLKIT_DLLPUBLIC ListBox : public Control
public:
~ListBox ();
- sal_uInt16 InsertEntry( String const& rStr, sal_uInt16 nPos=LISTBOX_APPEND );
-
- void RemoveEntry( String const& rStr );
- void RemoveEntry( sal_uInt16 nPos );
- void Clear();
sal_uInt16 GetEntryPos( String const& rStr ) const;
String GetEntry( sal_uInt16 nPos ) const;
- sal_uInt16 GetEntryCount() const;
- void SelectEntry( String const& rStr, bool bSelect=true );
void SelectEntryPos( sal_uInt16 nPos, bool bSelect=true );
- sal_uInt16 GetSelectEntryCount() const;
- String GetSelectEntry( sal_uInt16 nSelIndex=0 ) const;
sal_uInt16 GetSelectEntryPos( sal_uInt16 nSelIndex=0 ) const;
- void SetSelectHdl (Link const& link);
- Link& GetSelectHdl ();
-
- void SetClickHdl (Link const& link);
- Link& GetClickHdl ();
-
- void SetDoubleClickHdl (Link const& link);
- Link& GetDoubleClickHdl ();
-
- void SetEntryData (sal_uInt16 pos, void* data);
- void* GetEntryData (sal_uInt16 pos) const;
-
virtual void SetNoSelection ();
};
-class MultiListBoxImpl;
-class TOOLKIT_DLLPUBLIC MultiListBox : public ListBox
-{
- DECL_GET_IMPL( MultiListBox );
- DECL_CONSTRUCTORS( MultiListBox, ListBox, 0 );
- DECL_GET_WINDOW( MultiListBox );
-};
-
class DialogImpl;
class TOOLKIT_DLLPUBLIC Dialog : public Context, public Window
{
@@ -556,19 +344,14 @@ class TOOLKIT_DLLPUBLIC Dialog : public Context, public Window
public:
DECL_GET_IMPL (Dialog);
- Dialog( Window *parent, char const* xml_file, char const* id, sal_uInt32 nId=0 );
Dialog( ::Window *parent, char const* xml_file, char const* id, sal_uInt32 nId=0 );
~Dialog ();
virtual short Execute();
void EndDialog( long nResult=0 );
- void SetText( rtl::OUString const& rStr );
void SetTitle (rtl::OUString const& rStr );
- bool Close ();
- long Notify (NotifyEvent & event);
// Sxf*Dialog
bool bConstruct;
- void Initialize (SfxChildWinInfo*);
};
#define DECL_MESSAGE_BOX_CTORS(Name)\
@@ -624,8 +407,6 @@ protected:
typedef MessageBox MessBox;
CLASS_MESSAGE_BOX (Error);
CLASS_MESSAGE_BOX (Info);
-CLASS_MESSAGE_BOX (Query);
-CLASS_MESSAGE_BOX (Warning);
#undef CLASS_MESSAGE_BOX
@@ -639,27 +420,13 @@ class TOOLKIT_DLLPUBLIC TabControl : public Control
//#endif /* !TAB_APPEND */
DECL_GET_IMPL (TabControl);
- DECL_CONSTRUCTORS (TabControl, Control, 0);
DECL_GET_WINDOW (TabControl);
- DECL_GET_LAYOUT_VCLXWINDOW (TabControl);
public:
~TabControl ();
- void InsertPage (sal_uInt16 id, rtl::OUString const& title, sal_uInt16 pos=TAB_APPEND);
- void RemovePage (sal_uInt16 id);
- sal_uInt16 GetPageCount () const;
- sal_uInt16 GetPageId (sal_uInt16 pos) const;
- sal_uInt16 GetPagePos (sal_uInt16 id) const;
void SetCurPageId (sal_uInt16 id);
- sal_uInt16 GetCurPageId () const;
- void SetTabPage (sal_uInt16 id, ::TabPage* page);
- ::TabPage* GetTabPage (sal_uInt16 id) const;
void SetActivatePageHdl (Link const& link);
- Link& GetActivatePageHdl () const;
void SetDeactivatePageHdl (Link const& link);
- Link& GetDeactivatePageHdl () const;
- void SetTabPageSizePixel (Size const& size);
- Size GetTabPageSizePixel () const;
};
class TabPageImpl;
@@ -670,27 +437,12 @@ public:
static ::Window* global_parent;
static TabControl* global_tabcontrol;
- TabPage( Window *parent, char const* xml_file, char const* id, sal_uInt32 nId=0 );
- TabPage( ::Window *parent, char const* xml_file, char const* id, sal_uInt32 nId=0 );
~TabPage();
DECL_GET_WINDOW( TabPage );
virtual void ActivatePage();
virtual void DeactivatePage();
};
-class ProgressBarImpl;
-class TOOLKIT_DLLPUBLIC ProgressBar : public Control
-{
- DECL_GET_IMPL( ProgressBar );
- DECL_CONSTRUCTORS( ProgressBar, Control, WB_BORDER );
-public:
- void SetForegroundColor( css::util::Color color );
- void SetBackgroundColor( css::util::Color color );
- void SetValue( sal_Int32 i );
- void SetRange( sal_Int32 min, sal_Int32 max );
- sal_Int32 GetValue();
-};
-
// -----------------------------------------------------------------
// layout container / helper wrappers
// -----------------------------------------------------------------
@@ -703,18 +455,10 @@ protected:
public:
Container( Context const* context, char const* id );
- void Add( Window *pWindow );
- void Add( Container *pContainer );
-
- void Remove( Window *pWindow );
- void Remove( Container *pContainer );
- void Clear();
// we can't really do a GetChildren() as they don't have a common class,
// besides we would need to keep track of children, uh
void ShowAll( bool bVisible );
- void Show();
- void Hide();
css::uno::Reference< css::awt::XLayoutContainer > getImpl()
{ return mxContainer; }
@@ -722,16 +466,6 @@ public:
class TOOLKIT_DLLPUBLIC Table : public Container
{
-protected:
- Table( sal_Int32 nBorder, sal_Int32 nColumns );
-public:
- Table( Context const* context, char const* id );
- void Add( Window *pWindow, bool bXExpand, bool bYExpand,
- sal_Int32 nXSpan=1, sal_Int32 nYSpan=1 );
- void Add( Container *pContainer, bool bXExpand, bool bYExpand,
- sal_Int32 nXSpan=1, sal_Int32 nYSpan=1 );
-
-private:
void setProps( css::uno::Reference< css::awt::XLayoutConstrains > xChild,
bool bXExpand, bool bYExpand, sal_Int32 nXSpan, sal_Int32 nYSpan );
};
@@ -742,64 +476,18 @@ protected:
Box( rtl::OUString const& rName, sal_Int32 nBorder, bool bHomogeneous );
public:
Box( Context const* context, char const* id );
- void Add( Window *pWindow, bool bExpand, bool bFill, sal_Int32 nPadding);
- void Add( Container *pContainer, bool bExpand, bool bFill, sal_Int32 nPadding);
private:
void setProps( css::uno::Reference< css::awt::XLayoutConstrains > xChild,
bool bXExpand, bool bYExpand, sal_Int32 nPadding );
};
-class TOOLKIT_DLLPUBLIC HBox : public Box
-{
-public:
- HBox( Context const* context, char const* id );
- HBox( sal_Int32 nBorder, bool bHomogeneous );
-};
-class TOOLKIT_DLLPUBLIC VBox : public Box
-{
-public:
- VBox( Context const* context, char const* id );
- VBox( sal_Int32 nBorder, bool bHomogeneous );
-};
-
-class PluginImpl;
-class TOOLKIT_DLLPUBLIC Plugin : public Control
-{
- DECL_GET_IMPL( Plugin );
-public:
- ::Control *mpPlugin;
- Plugin( Context *context, char const* id, ::Control *plugin );
-};
-
-class LocalizedStringImpl;
-class TOOLKIT_DLLPUBLIC LocalizedString : public Window
-{
- DECL_GET_IMPL( LocalizedString );
-
-public:
- LocalizedString( Context *context, char const* id );
-
- rtl::OUString operator= (rtl::OUString const&);
- rtl::OUString operator+= (sal_Unicode );
- rtl::OUString operator+= (rtl::OUString const&);
-
- operator rtl::OUString ();
- operator rtl::OUString const& ();
- operator String();
- String getString ();
- rtl::OUString getOUString ();
- String GetToken (sal_uInt16 i, sal_Char c);
-};
-
class InPlugImpl;
class TOOLKIT_DLLPUBLIC InPlug : public Context, public Window
{
DECL_GET_IMPL (InPlug);
public:
- InPlug ( Window *parent, char const* xml_file, char const* id, sal_uInt32 nId=0);
- InPlug ( ::Window *parent, char const* xml_file, char const* id, sal_uInt32 nId=0);
void ParentSet (Window *window);
};
diff --git a/toolkit/source/layout/vcl/wbutton.cxx b/toolkit/source/layout/vcl/wbutton.cxx
index 5c72b1707f3d..f3272dcc1c85 100644
--- a/toolkit/source/layout/vcl/wbutton.cxx
+++ b/toolkit/source/layout/vcl/wbutton.cxx
@@ -31,8 +31,6 @@
#include <com/sun/star/awt/PosSize.hpp>
#include <com/sun/star/awt/XActionListener.hpp>
#include <com/sun/star/awt/XButton.hpp>
-#include <com/sun/star/awt/XCheckBox.hpp>
-#include <com/sun/star/awt/XRadioButton.hpp>
#include <com/sun/star/graphic/XGraphic.hpp>
#include <cppuhelper/implbase1.hxx>
#include <toolkit/awt/vclxwindow.hxx>
@@ -69,16 +67,6 @@ class ImageImpl
}
};
-Image::Image( const char *pName )
- : pImpl( new ImageImpl( pName ) )
-{
-}
-
-Image::~Image()
-{
- delete pImpl;
-}
-
class ButtonImpl : public ControlImpl
, public ::cppu::WeakImplHelper1< awt::XActionListener >
{
@@ -150,38 +138,11 @@ void Button::SetText( OUString const& rStr )
getImpl().mxButton->setLabel( rStr );
}
-void Button::SetClickHdl( const Link& link )
-{
- if (&getImpl () && getImpl().mxButton.is ())
- getImpl().SetClickHdl( link );
-}
-
-Link& Button::GetClickHdl ()
-{
- return getImpl().GetClickHdl ();
-}
-
-bool Button::SetModeImage (Image const& image)
-{
- return getImpl().SetModeImage (image.getImpl().mxGraphic);
-}
-
-bool Button::SetModeImage (::Image const& image)
-{
- return GetButton ()->SetModeImage (image);
-}
-
-void Button::SetImageAlign( ImageAlign eAlign )
-{
- getImpl().setProperty( "ImageAlign", uno::Any( (sal_Int16) eAlign ) );
-}
-
void Button::Click()
{
}
IMPL_GET_IMPL( Button );
-IMPL_CONSTRUCTORS( Button, Control, "button" );
IMPL_GET_WINDOW (Button);
class PushButtonImpl : public ButtonImpl
@@ -239,16 +200,6 @@ void PushButton::Check( bool bCheck )
getImpl().fireToggle();
}
-bool PushButton::IsChecked() const
-{
- return !!( getImpl().getProperty( "State" ).get< sal_Int16 >() );
-}
-
-void PushButton::Toggle()
-{
- Check( true );
-}
-
void PushButton::SetToggleHdl( const Link& link )
{
if (&getImpl () && getImpl().mxButton.is ())
@@ -256,173 +207,8 @@ void PushButton::SetToggleHdl( const Link& link )
}
IMPL_GET_IMPL( PushButton );
-IMPL_CONSTRUCTORS( PushButton, Button, "pushbutton" );
IMPL_GET_WINDOW (PushButton);
-class RadioButtonImpl : public ButtonImpl
- , public ::cppu::WeakImplHelper1< awt::XItemListener >
-{
- Link maToggleHdl;
-public:
- uno::Reference< awt::XRadioButton > mxRadioButton;
- RadioButtonImpl( Context *context, const PeerHandle &peer, Window *window )
- : ButtonImpl( context, peer, window )
- , mxRadioButton( peer, uno::UNO_QUERY )
- {
- }
-
- void Check( bool bCheck )
- {
- if ( !mxRadioButton.is() )
- return;
-
- // Have setState fire item event for
- // RadioGroups::RadioGroup::itemStateChanged ()
- ::RadioButton *r = static_cast<RadioButton*>(mpWindow)->GetRadioButton ();
- bool state = r->IsRadioCheckEnabled ();
- r->EnableRadioCheck();
- mxRadioButton->setState( !!bCheck );
- r->EnableRadioCheck (state);
- fireToggle();
- }
-
- bool IsChecked()
- {
- if ( !mxRadioButton.is() )
- return false;
- return mxRadioButton->getState();
- }
-
- void SetToggleHdl( const Link& link )
- {
- if (!link && !!maToggleHdl)
- mxRadioButton->removeItemListener( this );
- else if (!!link && !maToggleHdl)
- mxRadioButton->addItemListener( this );
- maToggleHdl = link;
- }
-
- inline void fireToggle()
- {
- maToggleHdl.Call( static_cast<Window *>( mpWindow ) );
- }
-
- virtual void SetClickHdl( const Link& link )
- {
- // Keep RadioGroups::RadioGroup's actionListener at HEAD
- // of list. This way, it can handle RadioGroup's button
- // states before all other callbacks and make sure the
- // client code has the right state.
-
- // IWBN to add an XRadioButton2 and layout::VCLXRadioButton
- // with {get,set}RadioGroup() (and a "radiogroup" property
- // even) and handle the grouping here in RadioButtonImpl.
- uno::Reference< uno::XInterface > x = static_cast<VCLXRadioButton*> (mpWindow->GetVCLXWindow ())->getFirstActionListener ();
- uno::Reference< awt::XActionListener > a = uno::Reference< awt::XActionListener> (x ,uno::UNO_QUERY );
- mxButton->removeActionListener (a);
- ButtonImpl::SetClickHdl (link);
- mxButton->addActionListener (a);
- }
-
- void SAL_CALL disposing( lang::EventObject const& e )
- throw (uno::RuntimeException)
- {
- ButtonImpl::disposing (e);
- }
-
- virtual void SAL_CALL itemStateChanged( const awt::ItemEvent& )
- throw (uno::RuntimeException)
- {
- maToggleHdl.Call( static_cast<Window *>( mpWindow ) );
- }
-};
-
-RadioButton::~RadioButton ()
-{
- SetToggleHdl (Link ());
-}
-
-void RadioButton::Check( bool bCheck )
-{
- getImpl().Check( bCheck );
-}
-
-bool RadioButton::IsChecked() const
-{
- return getImpl().IsChecked();
-}
-
-void RadioButton::SetToggleHdl( const Link& link )
-{
- if (&getImpl () && getImpl().mxRadioButton.is ())
- getImpl().SetToggleHdl( link );
-}
-
-IMPL_GET_IMPL( RadioButton );
-IMPL_GET_WINDOW( RadioButton );
-IMPL_GET_VCLXWINDOW( RadioButton );
-IMPL_CONSTRUCTORS( RadioButton, Button, "radiobutton" );
-
-class CheckBoxImpl : public ButtonImpl
- , public ::cppu::WeakImplHelper1< awt::XItemListener >
-{
- Link maToggleHdl;
- public:
- uno::Reference< awt::XCheckBox > mxCheckBox;
- CheckBoxImpl( Context *context, const PeerHandle &peer, Window *window )
- : ButtonImpl( context, peer, window )
- , mxCheckBox( peer, uno::UNO_QUERY )
- {
- }
-
- void SetToggleHdl( const Link& link )
- {
- if (!link && !!maToggleHdl)
- mxCheckBox->removeItemListener( this );
- else if (!!link && !maToggleHdl)
- mxCheckBox->addItemListener( this );
- maToggleHdl = link;
- }
- void SAL_CALL disposing( lang::EventObject const& e )
- throw (uno::RuntimeException)
- {
- ButtonImpl::disposing (e);
- }
- virtual void SAL_CALL itemStateChanged( const awt::ItemEvent& )
- throw (uno::RuntimeException)
- {
- maToggleHdl.Call( static_cast<Window *>( mpWindow ) );
- }
-};
-
-CheckBox::~CheckBox ()
-{
- SetToggleHdl (Link ());
-}
-
-void CheckBox::Check( bool bCheck )
-{
- if ( !getImpl().mxCheckBox.is() )
- return;
- getImpl().mxCheckBox->setState( !!bCheck );
-}
-
-bool CheckBox::IsChecked() const
-{
- if ( !getImpl().mxCheckBox.is() )
- return false;
- return getImpl().mxCheckBox->getState() != 0;
-}
-
-void CheckBox::SetToggleHdl( const Link& link )
-{
- if (&getImpl () && getImpl().mxCheckBox.is ())
- getImpl().SetToggleHdl( link );
-}
-
-IMPL_GET_IMPL( CheckBox );
-IMPL_CONSTRUCTORS( CheckBox, Button, "checkbox" );
-
#define BUTTON_IMPL(t, parent, response) \
class t##Impl : public parent##Impl \
{ \
@@ -447,232 +233,59 @@ IMPL_CONSTRUCTORS( CheckBox, Button, "checkbox" );
#define BUTTONID_RESET RET_RESET
#define BUTTONID_APPLY RET_APPLY
-BUTTON_IMPL( OKButton, PushButton, BUTTONID_OK );
BUTTON_IMPL( CancelButton, PushButton, BUTTONID_CANCEL );
BUTTON_IMPL( YesButton, PushButton, BUTTONID_YES );
BUTTON_IMPL( NoButton, PushButton, BUTTONID_NO );
BUTTON_IMPL( RetryButton, PushButton, BUTTONID_RETRY );
BUTTON_IMPL( IgnoreButton, PushButton, BUTTONID_IGNORE );
-BUTTON_IMPL( ResetButton, PushButton, BUTTONID_RESET );
-BUTTON_IMPL( ApplyButton, PushButton, BUTTONID_APPLY ); /* Deprecated? */
BUTTON_IMPL( HelpButton, PushButton, BUTTONID_HELP );
-IMPL_CONSTRUCTORS( OKButton, PushButton, "okbutton" );
-IMPL_CONSTRUCTORS( CancelButton, PushButton, "cancelbutton" );
-IMPL_CONSTRUCTORS( YesButton, PushButton, "yesbutton" );
-IMPL_CONSTRUCTORS( NoButton, PushButton, "nobutton" );
-IMPL_CONSTRUCTORS( RetryButton, PushButton, "retrybutton" );
-IMPL_CONSTRUCTORS( IgnoreButton, PushButton, "ignorebutton" );
-IMPL_CONSTRUCTORS( ResetButton, PushButton, "resetbutton" );
-IMPL_CONSTRUCTORS( ApplyButton, PushButton, "applybutton" ); /* Deprecated? */
-IMPL_CONSTRUCTORS( HelpButton, PushButton, "helpbutton" );
-
-IMPL_IMPL (ImageButton, PushButton)
-
-
-IMPL_CONSTRUCTORS( ImageButton, PushButton, "imagebutton" );
-
-class AdvancedButtonImpl : public PushButtonImpl
-{
-protected:
- bool bAdvancedMode;
- std::list< Window*> maAdvanced;
- std::list< Window*> maSimple;
-
-public:
- rtl::OUString mAdvancedLabel;
- rtl::OUString mSimpleLabel;
-
-protected:
- Window* Remove( std::list< Window*> lst, Window* w )
- {
- for ( std::list< Window*>::iterator it = maAdvanced.begin();
- it != maAdvanced.end(); ++it )
- if ( *it == w )
- {
- it = lst.erase( it );
- return *it;
- }
- return 0;
- }
-
-public:
- AdvancedButtonImpl( Context *context, PeerHandle const& peer, Window *window )
- : PushButtonImpl( context, peer, window )
- , bAdvancedMode( false )
- // TODO: i18n
- // Button::GetStandardText( BUTTON_ADVANCED );
- // Button::GetStandardText( BUTTON_SIMPLE );
- , mAdvancedLabel( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Advanced...")) )
- , mSimpleLabel( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Simple...")) )
- {
- }
- void Click()
- {
- bAdvancedMode = !bAdvancedMode;
- if ( bAdvancedMode )
- advancedMode();
- else
- simpleMode();
- }
- void setAlign ()
- {
- ::PushButton *b = static_cast<PushButton*> (mpWindow)->GetPushButton ();
- b->SetSymbolAlign (SYMBOLALIGN_RIGHT);
- b->SetSmallSymbol ();
- //mpWindow->SetStyle (mpWindow->GetStyle() | WB_CENTER);
- }
- void advancedMode()
- {
- ::PushButton *b = static_cast<PushButton*> (mpWindow)->GetPushButton ();
- b->SetSymbol (SYMBOL_PAGEUP);
- setAlign ();
- if (mSimpleLabel.getLength ())
- b->SetText (mSimpleLabel);
- for ( std::list< Window*>::iterator it = maAdvanced.begin();
- it != maAdvanced.end(); ++it )
- ( *it )->Show();
- for ( std::list< Window*>::iterator it = maSimple.begin();
- it != maSimple.end(); ++it )
- ( *it )->Hide();
-
- redraw ();
- }
- void simpleMode()
- {
- //mxButton->setLabel( mSimpleLabel );
- ::PushButton *b = static_cast<PushButton*> (mpWindow)->GetPushButton ();
- b->SetSymbol (SYMBOL_PAGEDOWN);
- if (mAdvancedLabel.getLength ())
- b->SetText (mAdvancedLabel);
- setAlign ();
- for ( std::list< Window*>::iterator it = maAdvanced.begin();
- it != maAdvanced.end(); ++it )
- ( *it )->Hide();
- for ( std::list< Window*>::iterator it = maSimple.begin();
- it != maSimple.end(); ++it )
- ( *it )->Show();
-
- redraw (true);
- }
- void AddAdvanced( Window* w )
- {
- maAdvanced.push_back( w );
- if ( !bAdvancedMode )
- w->Hide();
- }
- void AddSimple( Window* w )
- {
- maSimple.push_back( w );
- if ( bAdvancedMode )
- w->Hide();
- }
- void RemoveAdvanced( Window* w )
- {
- Remove( maAdvanced, w );
- }
- void RemoveSimple( Window* w )
- {
- Remove( maSimple, w );
- }
-};
-
-void AdvancedButton::AddAdvanced( Window* w )
-{
- getImpl().AddAdvanced( w );
-}
-
-void AdvancedButton::AddSimple( Window* w )
-{
- getImpl().AddSimple( w );
-}
-
-void AdvancedButton::RemoveAdvanced( Window* w )
-{
- getImpl().RemoveAdvanced( w );
-}
-
-void AdvancedButton::RemoveSimple( Window* w )
-{
- getImpl().RemoveSimple( w );
-}
-
-void AdvancedButton::SetAdvancedText (rtl::OUString const& text)
-{
- if (text.getLength ())
- getImpl ().mAdvancedLabel = text;
-}
-
-void AdvancedButton::SetSimpleText (rtl::OUString const& text)
-{
- if (text.getLength ())
- getImpl ().mSimpleLabel = text;
-}
-
-rtl::OUString AdvancedButton::GetAdvancedText () const
-{
- return getImpl ().mAdvancedLabel;
-}
-
-rtl::OUString AdvancedButton::GetSimpleText () const
-{
- return getImpl ().mSimpleLabel;
-}
-
-void AdvancedButton::SetDelta (int)
-{
-}
-
-IMPL_CONSTRUCTORS_BODY( AdvancedButton, PushButton, "advancedbutton", getImpl().simpleMode () );
-IMPL_GET_IMPL( AdvancedButton );
-
-
-class MoreButtonImpl : public AdvancedButtonImpl
-{
-public:
- MoreButtonImpl( Context *context, PeerHandle const& peer, Window *window )
- : AdvancedButtonImpl( context, peer, window)
- {
- mSimpleLabel = Button::GetStandardText( BUTTON_MORE );
- mAdvancedLabel = Button::GetStandardText( BUTTON_LESS );
- }
- void AddWindow( Window* w ) { AddAdvanced( w ); }
- void RemoveWindow( Window* w ) { RemoveAdvanced( w ); }
-};
-
-// TODO
-//BUTTON_IMPL( MoreButton, PushButton, 0 );
-IMPL_CONSTRUCTORS_BODY( MoreButton, AdvancedButton, "morebutton", getImpl().simpleMode () );
-IMPL_GET_IMPL( MoreButton );
-
-void MoreButton::AddWindow( Window* w )
+CancelButton::CancelButton ( Context *context, char const* pId, sal_uInt32 nId )
+ : PushButton( new CancelButtonImpl( context, context->GetPeerHandle( pId, nId ), this ) )
{
- getImpl().AddWindow( w );
+ Window *parent = dynamic_cast<Window*> (context);
+ if (parent)
+ SetParent (parent);
}
-void MoreButton::RemoveWindow( Window* w )
+YesButton::YesButton ( Context *context, char const* pId, sal_uInt32 nId )
+ : PushButton( new YesButtonImpl( context, context->GetPeerHandle( pId, nId ), this ) )
{
- getImpl().RemoveWindow( w );
+ Window *parent = dynamic_cast<Window*> (context);
+ if (parent)
+ SetParent (parent);
}
-void MoreButton::SetMoreText (rtl::OUString const& text)
+NoButton::NoButton ( Context *context, char const* pId, sal_uInt32 nId )
+ : PushButton( new NoButtonImpl( context, context->GetPeerHandle( pId, nId ), this ) )
{
- SetAdvancedText (text);
+ Window *parent = dynamic_cast<Window*> (context);
+ if (parent)
+ SetParent (parent);
}
-void MoreButton::SetLessText (rtl::OUString const& text)
+RetryButton::RetryButton ( Context *context, char const* pId, sal_uInt32 nId )
+ : PushButton( new RetryButtonImpl( context, context->GetPeerHandle( pId, nId ), this ) )
{
- SetSimpleText (text);
+ Window *parent = dynamic_cast<Window*> (context);
+ if (parent)
+ SetParent (parent);
}
-rtl::OUString MoreButton::GetMoreText () const
+IgnoreButton::IgnoreButton ( Context *context, char const* pId, sal_uInt32 nId )
+ : PushButton( new IgnoreButtonImpl( context, context->GetPeerHandle( pId, nId ), this ) )
{
- return GetAdvancedText ();
+ Window *parent = dynamic_cast<Window*> (context);
+ if (parent)
+ SetParent (parent);
}
-rtl::OUString MoreButton::GetLessText () const
+HelpButton::HelpButton ( Context *context, char const* pId, sal_uInt32 nId )
+ : PushButton( new HelpButtonImpl( context, context->GetPeerHandle( pId, nId ), this ) )
{
- return GetSimpleText ();
+ Window *parent = dynamic_cast<Window*> (context);
+ if (parent)
+ SetParent (parent);
}
} // namespace layout
diff --git a/toolkit/source/layout/vcl/wcontainer.cxx b/toolkit/source/layout/vcl/wcontainer.cxx
index 699a1af14761..868915b33f47 100644
--- a/toolkit/source/layout/vcl/wcontainer.cxx
+++ b/toolkit/source/layout/vcl/wcontainer.cxx
@@ -57,50 +57,6 @@ Container::Container( rtl::OUString const& rName, sal_Int32 nBorder )
uno::Any( nBorder ) );
}
-void Container::Add( Window *pChild )
-{
- if ( pChild )
- {
- uno::Reference< awt::XLayoutConstrains > xChild( pChild->GetPeer(), uno::UNO_QUERY );
- mxContainer->addChild( xChild );
- }
-}
-
-void Container::Add( Container *pChild )
-{
- if ( pChild )
- {
- uno::Reference< awt::XLayoutConstrains > xChild( pChild->getImpl(), uno::UNO_QUERY );
- mxContainer->addChild( xChild );
- }
-}
-
-void Container::Remove( Window *pChild )
-{
- if ( pChild )
- {
- uno::Reference< awt::XLayoutConstrains > xChild( pChild->GetPeer(), uno::UNO_QUERY );
- mxContainer->removeChild( xChild );
- }
-}
-
-void Container::Remove( Container *pChild )
-{
- if ( pChild )
- {
- uno::Reference< awt::XLayoutConstrains > xChild( pChild->getImpl(), uno::UNO_QUERY );
- mxContainer->removeChild( xChild );
- }
-}
-
-void Container::Clear()
-{
- css::uno::Sequence< css::uno::Reference < css::awt::XLayoutConstrains > > children;
- children = mxContainer->getChildren();
- for (int i = 0; i < children.getLength(); i++)
- mxContainer->removeChild( children[i] );
-}
-
void Container::ShowAll( bool bShow )
{
struct inner
@@ -131,47 +87,6 @@ void Container::ShowAll( bool bShow )
inner::setChildrenVisible( mxContainer, bShow );
}
-void Container::Show()
-{
- ShowAll( true );
-}
-
-void Container::Hide()
-{
- ShowAll( false );
-}
-
-Table::Table( sal_Int32 nBorder, sal_Int32 nColumns )
- : Container( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "table" ) ), nBorder )
-{
- uno::Reference< beans::XPropertySet > xProps( mxContainer, uno::UNO_QUERY_THROW );
- xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Columns" ) ),
- uno::Any( nColumns ) );
-}
-
-void Table::Add( Window *window, bool bXExpand, bool bYExpand,
- sal_Int32 nXSpan, sal_Int32 nYSpan )
-{
- if ( !window )
- return;
- WindowImpl &rImpl = window->getImpl();
- uno::Reference< awt::XLayoutConstrains > xChild( rImpl.mxWindow,
- uno::UNO_QUERY );
- mxContainer->addChild( xChild );
- setProps( xChild, bXExpand, bYExpand, nXSpan, nYSpan );
-}
-
-void Table::Add( Container *pContainer, bool bXExpand, bool bYExpand,
- sal_Int32 nXSpan, sal_Int32 nYSpan )
-{
- if ( !pContainer )
- return;
- uno::Reference< awt::XLayoutConstrains > xChild( pContainer->getImpl(),
- uno::UNO_QUERY );
- mxContainer->addChild( xChild );
- setProps( xChild, bXExpand, bYExpand, nXSpan, nYSpan );
-}
-
void Table::setProps( uno::Reference< awt::XLayoutConstrains > xChild,
bool bXExpand, bool bYExpand, sal_Int32 nXSpan, sal_Int32 nYSpan )
{
@@ -195,29 +110,6 @@ Box::Box( rtl::OUString const& rName, sal_Int32 nBorder, bool bHomogeneous )
uno::Any( bHomogeneous ) );
}
-void Box::Add( Window *window, bool bExpand, bool bFill, sal_Int32 nPadding)
-{
- if ( !window )
- return;
- WindowImpl &rImpl = window->getImpl();
- uno::Reference< awt::XLayoutConstrains > xChild( rImpl.mxWindow,
- uno::UNO_QUERY );
-
- mxContainer->addChild( xChild );
- setProps( xChild, bExpand, bFill, nPadding );
-}
-
-void Box::Add( Container *pContainer, bool bExpand, bool bFill, sal_Int32 nPadding)
-{
- if ( !pContainer )
- return;
-
- uno::Reference< awt::XLayoutConstrains > xChild( pContainer->getImpl(),
- uno::UNO_QUERY );
- mxContainer->addChild( xChild );
- setProps( xChild, bExpand, bFill, nPadding );
-}
-
void Box::setProps( uno::Reference< awt::XLayoutConstrains > xChild,
bool bExpand, bool bFill, sal_Int32 nPadding )
{
@@ -232,38 +124,11 @@ void Box::setProps( uno::Reference< awt::XLayoutConstrains > xChild,
uno::Any( nPadding ) );
}
-Table::Table( Context const* context, char const* pId )
- : Container( context, pId )
-{
-}
-
Box::Box( Context const* context, char const* pId )
: Container( context, pId )
{
}
-HBox::HBox( sal_Int32 nBorder, bool bHomogeneous )
- : Box( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "hbox" ) ),
- nBorder, bHomogeneous )
-{
-}
-
-HBox::HBox( Context const* context, char const* pId )
- : Box( context, pId )
-{
-}
-
-VBox::VBox( sal_Int32 nBorder, bool bHomogeneous )
- : Box( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "vbox" ) ),
- nBorder, bHomogeneous )
-{
-}
-
-VBox::VBox( Context const* context, char const* pId )
- : Box( context, pId )
-{
-}
-
} // namespace layout
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/source/layout/vcl/wfield.cxx b/toolkit/source/layout/vcl/wfield.cxx
index ce8b59f6023f..04b0757ca999 100644
--- a/toolkit/source/layout/vcl/wfield.cxx
+++ b/toolkit/source/layout/vcl/wfield.cxx
@@ -33,7 +33,6 @@
#include <com/sun/star/awt/XNumericField.hpp>
#include <com/sun/star/awt/XTextComponent.hpp>
#include <com/sun/star/awt/XListBox.hpp>
-#include <com/sun/star/awt/XComboBox.hpp>
#include <cppuhelper/implbase1.hxx>
#include <com/sun/star/awt/XActionListener.hpp>
#include <com/sun/star/awt/XItemListener.hpp>
@@ -103,89 +102,15 @@ Edit::~Edit ()
SetModifyHdl (Link ());
}
-void Edit::SetSelection( Selection const& rSelection )
-{
-#if LAYOUT_API_CALLS_HANDLER
- if ( !getImpl().mxEdit.is() )
- getImpl().mxEdit->setSelection( awt::Selection( rSelection.Min(), rSelection.Max() ) );
-#else /* !LAYOUT_API_CALLS_HANDLER */
- GetEdit ()->SetSelection (rSelection);
-#endif /* !LAYOUT_API_CALLS_HANDLER */
-}
-
-void Edit::SetText( OUString const& rStr )
-{
-#if LAYOUT_API_CALLS_HANDLER
- if ( getImpl().mxEdit.is() )
- /// this calls handlers; endless loop in numfmt.cxx
- getImpl().mxEdit->setText( rStr );
-#else /* !LAYOUT_API_CALLS_HANDLER */
- GetEdit ()->SetText (rStr);
-#endif /* !LAYOUT_API_CALLS_HANDLER */
-}
-
-String Edit::GetText() const
-{
- if ( !getImpl().mxEdit.is() )
- return getImpl().mxEdit->getText();
- return OUString();
-}
-
void Edit::SetModifyHdl( const Link& link )
{
if (&getImpl () && getImpl().mxEdit.is ())
getImpl().SetModifyHdl( link );
}
-IMPL_CONSTRUCTORS( Edit, Control, "edit" );
IMPL_GET_IMPL( Edit );
IMPL_GET_WINDOW (Edit);
-class MultiLineEditImpl : public EditImpl
-{
-public:
- MultiLineEditImpl( Context *context, const PeerHandle &peer, Window *window )
- : EditImpl( context, peer, window )
- {
- }
-};
-
-IMPL_CONSTRUCTORS( MultiLineEdit, Edit, "multilineedit" );
-IMPL_GET_IMPL( MultiLineEdit );
-
-class SpinFieldImpl : public EditImpl
-{
- public:
- SpinFieldImpl( Context *context, const PeerHandle &peer, Window *window )
- : EditImpl( context, peer, window )
- {
- }
-};
-
-IMPL_CONSTRUCTORS( SpinField, Edit, "spinfield" );
-
-class NumericFieldImpl : public SpinFieldImpl
-{
- public:
- NumericFieldImpl( Context *context, const PeerHandle &peer, Window *window )
- : SpinFieldImpl( context, peer, window )
- {
- }
-};
-
-class MetricFieldImpl : public SpinFieldImpl
-{
- public:
- MetricFieldImpl( Context *context, const PeerHandle &peer, Window *window )
- : SpinFieldImpl( context, peer, window )
- {
- }
-};
-
-IMPL_GET_IMPL( SpinField );
-IMPL_GET_IMPL( NumericField );
-IMPL_GET_IMPL( MetricField );
-
class FormatterBaseImpl
{
protected:
@@ -252,32 +177,6 @@ NumericFormatterImpl& NumericFormatter::getFormatImpl() const
return *( static_cast<NumericFormatterImpl *>( mpFormatImpl ) );
}
-#define SET_IMPL(vclmethod, idlmethod) \
- void NumericFormatter::vclmethod( sal_Int64 nValue ) \
- { \
- if ( !getFormatImpl().mxField.is() ) \
- return; \
- getFormatImpl().mxField->idlmethod( getFormatImpl().valueToDouble( nValue ) ); \
- }
-
-SET_IMPL( SetMin, setMin )
-SET_IMPL( SetMax, setMax )
-SET_IMPL( SetLast, setLast )
-SET_IMPL( SetFirst, setFirst )
-SET_IMPL( SetValue, setValue )
-SET_IMPL( SetSpinSize, setSpinSize )
-
-sal_Int64 NumericFormatter::GetValue() const
-{
- if ( !getFormatImpl().mxField.is() )
- return 0;
- return getFormatImpl().doubleToValue( getFormatImpl().mxField->getValue() );
-}
-
-#undef SET_IMPL
-
-IMPL_CONSTRUCTORS_2( NumericField, SpinField, NumericFormatter, "numericfield" );
-
MetricFormatter::MetricFormatter( FormatterBaseImpl *pImpl )
: FormatterBase( pImpl )
{
@@ -285,225 +184,6 @@ MetricFormatter::MetricFormatter( FormatterBaseImpl *pImpl )
MetricFormatterImpl& MetricFormatter::getFormatImpl() const
{ return *( static_cast<MetricFormatterImpl *>( mpFormatImpl ) ); }
-#define MetricUnitVclToUno(a) ((sal_uInt16)(a))
-
-#define SET_IMPL(vclmethod, idlmethod) \
- void MetricFormatter::vclmethod( sal_Int64 nValue, FieldUnit nUnit ) \
- { \
- if ( !getFormatImpl().mxField.is() ) \
- return; \
- getFormatImpl().mxField->idlmethod( nValue, MetricUnitVclToUno( nUnit ) ); \
- }
-
-SET_IMPL( SetMin, setMin )
-SET_IMPL( SetMax, setMax )
-SET_IMPL( SetLast, setLast )
-SET_IMPL( SetFirst, setFirst )
-SET_IMPL( SetValue, setValue )
-
-#undef SET_IMPL
-
-void MetricFormatter::SetSpinSize( sal_Int64 nValue )
-{
- if ( !getFormatImpl().mxField.is() )
- return;
- getFormatImpl().mxField->setSpinSize( nValue );
-}
-
-sal_Int64 MetricFormatter::GetValue( FieldUnit nUnit ) const
-{
- if ( !getFormatImpl().mxField.is() )
- return 0;
- return getFormatImpl().mxField->getValue( MetricUnitVclToUno( nUnit ) );
-}
-
-IMPL_CONSTRUCTORS_2( MetricField, SpinField, MetricFormatter, "metricfield" );
-
-class ComboBoxImpl : public EditImpl
- , public ::cppu::WeakImplHelper1< awt::XActionListener >
- , public ::cppu::WeakImplHelper1< awt::XItemListener >
-{
-public:
- uno::Reference< awt::XComboBox > mxComboBox;
-
- Link maClickHdl;
- Link maSelectHdl;
-
- Window *parent;
-
- ComboBoxImpl( Context *context, const PeerHandle &peer, Window *window )
- : EditImpl( context, peer, window )
- , mxComboBox( peer, uno::UNO_QUERY )
- {
- }
-
- ~ComboBoxImpl ();
-
- sal_uInt16 InsertEntry( OUString const& rStr, sal_uInt16 nPos )
- {
- if ( nPos == COMBOBOX_APPEND )
- nPos = GetEntryCount();
- mxComboBox->addItem( rtl::OUString( rStr ), nPos );
- return nPos;
- }
-
- void RemoveEntry( sal_uInt16 nPos )
- {
- mxComboBox->removeItems( nPos, 1 );
- }
-
- sal_uInt16 GetEntryPos( String const& rStr ) const
- {
- uno::Sequence< rtl::OUString> aItems( mxComboBox->getItems() );
- rtl::OUString rKey( rStr );
- sal_uInt16 n = sal::static_int_cast< sal_uInt16 >(aItems.getLength());
- for (sal_uInt16 i = 0; i < n; i++)
- {
- if ( aItems[ i ] == rKey )
- return i;
- }
- return COMBOBOX_ENTRY_NOTFOUND;
- }
-
- OUString GetEntry( sal_uInt16 nPos ) const
- {
- return OUString( mxComboBox->getItem( nPos ) );
- }
-
- sal_uInt16 GetEntryCount() const
- {
- return mxComboBox->getItemCount();
- }
-
- void SetClickHdl( Link const& link )
- {
- if (!link && !!maClickHdl)
- mxComboBox->removeActionListener( this );
- else if (!!link && !maClickHdl)
- mxComboBox->addActionListener( this );
- maClickHdl = link;
- }
-
- void SetSelectHdl( Link const& link )
- {
- if (!link && !!maSelectHdl)
- mxComboBox->removeItemListener( this );
- else if (!!link && !maSelectHdl)
- mxComboBox->addItemListener( this );
- maSelectHdl = link;
- }
-
- void SAL_CALL disposing( lang::EventObject const& e )
- throw (uno::RuntimeException);
-
- void SAL_CALL actionPerformed (const awt::ActionEvent&)
- throw (uno::RuntimeException)
- {
- ComboBox* pComboBox = static_cast<ComboBox*>( mpWindow );
- if ( !pComboBox )
- return;
- maClickHdl.Call( pComboBox );
- }
-
- void SAL_CALL itemStateChanged( awt::ItemEvent const&)
- throw (uno::RuntimeException)
- {
- ComboBox* pComboBox = static_cast<ComboBox*>( mpWindow );
- if ( !pComboBox )
- return;
- maSelectHdl.Call( pComboBox );
- }
-};
-
-ComboBox::~ComboBox ()
-{
-#ifndef __SUNPRO_CC
- OSL_TRACE ("%s: deleting ComboBox for window: %p", __FUNCTION__, GetWindow ());
-#endif
-}
-
-ComboBoxImpl::~ComboBoxImpl ()
-{
-#ifndef __SUNPRO_CC
- OSL_TRACE ("%s: deleting ComboBoxImpl for window: %p", __FUNCTION__, mpWindow ? mpWindow->GetWindow () : 0);
- OSL_TRACE ("%s: deleting ComboBoxImpl for listener: %p", __FUNCTION__, static_cast<XFocusListener*> (this));
-#endif
-}
-
-void ComboBoxImpl::disposing( lang::EventObject const& e )
- throw (uno::RuntimeException)
-{
- EditImpl::disposing (e);
- mxComboBox.clear ();
-}
-
-sal_uInt16 ComboBox::InsertEntry( String const& rStr, sal_uInt16 nPos )
-{
- return getImpl().InsertEntry( rStr, nPos );
-}
-
-void ComboBox::RemoveEntry( String const& rStr )
-{
- getImpl().RemoveEntry( GetEntryPos( rStr ) );
-}
-
-void ComboBox::RemoveEntry( sal_uInt16 nPos )
-{
- getImpl().RemoveEntry( nPos );
-}
-
-void ComboBox::Clear()
-{
- uno::Sequence< rtl::OUString> aNoItems;
- getImpl().setProperty( "StringItemList", uno::Any( aNoItems ) );
-}
-
-sal_uInt16 ComboBox::GetEntryPos( String const& rStr ) const
-{
- return getImpl().GetEntryPos( rStr );
-}
-
-String ComboBox::GetEntry( sal_uInt16 nPos ) const
-{
- rtl::OUString rItem = getImpl().mxComboBox->getItem( nPos );
- return OUString( rItem );
-}
-
-sal_uInt16 ComboBox::GetEntryCount() const
-{
- return getImpl().GetEntryCount();
-}
-
-void ComboBox::SetClickHdl( const Link& link )
-{
- if (&getImpl () && getImpl().mxComboBox.is ())
- getImpl().SetClickHdl( link );
-}
-
-void ComboBox::SetSelectHdl( const Link& link )
-{
- if (&getImpl () && getImpl().mxComboBox.is ())
- getImpl().SetSelectHdl( link );
-}
-
-void ComboBox::EnableAutocomplete (bool enable, bool matchCase)
-{
- GetComboBox ()->EnableAutocomplete (enable, matchCase);
-}
-
-IMPL_CONSTRUCTORS_BODY( ComboBox, Edit, "combobox", getImpl().parent = parent; );
-IMPL_GET_WINDOW (ComboBox);
-/// IMPL_GET_IMPL( ComboBox );
-
-static ComboBoxImpl* null_combobox_impl = 0;
-
-ComboBoxImpl &ComboBox::getImpl () const
-{
- if (ComboBoxImpl* c = static_cast<ComboBoxImpl *>(mpImpl))
- return *c;
- return *null_combobox_impl;
-}
-
class ListBoxImpl : public ControlImpl
, public ::cppu::WeakImplHelper1< awt::XActionListener >
, public ::cppu::WeakImplHelper1< awt::XItemListener >
@@ -671,27 +351,6 @@ ListBox::~ListBox ()
{
}
-sal_uInt16 ListBox::InsertEntry (String const& rStr, sal_uInt16 nPos)
-{
- return getImpl().InsertEntry(rStr, nPos);
-}
-
-void ListBox::RemoveEntry( sal_uInt16 nPos )
-{
- return getImpl().RemoveEntry( nPos );
-}
-
-void ListBox::RemoveEntry( String const& rStr )
-{
- return getImpl().RemoveEntry( GetEntryPos( rStr ) );
-}
-
-void ListBox::Clear()
-{
- uno::Sequence< rtl::OUString> aNoItems;
- getImpl().setProperty( "StringItemList", uno::Any( aNoItems ) );
-}
-
sal_uInt16 ListBox::GetEntryPos( String const& rStr ) const
{
return getImpl().GetEntryPos( rStr );
@@ -702,11 +361,6 @@ String ListBox::GetEntry( sal_uInt16 nPos ) const
return getImpl().GetEntry( nPos );
}
-sal_uInt16 ListBox::GetEntryCount() const
-{
- return getImpl().GetEntryCount();
-}
-
void ListBox::SelectEntryPos( sal_uInt16 nPos, bool bSelect )
{
#if LAYOUT_API_CALLS_HANDLER
@@ -716,80 +370,19 @@ void ListBox::SelectEntryPos( sal_uInt16 nPos, bool bSelect )
#endif /* !LAYOUT_API_CALLS_HANDLER */
}
-void ListBox::SelectEntry( String const& rStr, bool bSelect )
-{
- SelectEntryPos( GetEntryPos( rStr ), bSelect );
-}
-
-sal_uInt16 ListBox::GetSelectEntryCount() const
-{
- return getImpl().GetSelectEntryCount();
-}
-
sal_uInt16 ListBox::GetSelectEntryPos( sal_uInt16 nSelIndex ) const
{
return getImpl().GetSelectEntryPos( nSelIndex );
}
-String ListBox::GetSelectEntry( sal_uInt16 nSelIndex ) const
-{
- return GetEntry( GetSelectEntryPos( nSelIndex ) );
-}
-
-Link& ListBox::GetSelectHdl ()
-{
- return getImpl ().GetSelectHdl ();
-}
-
-void ListBox::SetSelectHdl( Link const& link )
-{
- getImpl().SetSelectHdl( link );
-}
-
-Link& ListBox::GetClickHdl ()
-{
- return getImpl ().GetSelectHdl ();
-}
-
-void ListBox::SetClickHdl( Link const& link )
-{
- if (&getImpl () && getImpl().mxListBox.is ())
- getImpl().SetClickHdl( link );
-}
-
-Link& ListBox::GetDoubleClickHdl ()
-{
- return getImpl ().GetSelectHdl ();
-}
-
-void ListBox::SetDoubleClickHdl( Link const& link )
-{
- getImpl().SetDoubleClickHdl( link );
-}
-
-void ListBox::SetEntryData( sal_uInt16 pos, void* data)
-{
- GetListBox ()->SetEntryData (pos, data);
-}
-
-void* ListBox::GetEntryData( sal_uInt16 pos) const
-{
- return GetListBox ()->GetEntryData (pos);
-}
-
void ListBox::SetNoSelection ()
{
GetListBox ()->SetNoSelection ();
}
-IMPL_CONSTRUCTORS (ListBox, Control, "listbox");
IMPL_GET_IMPL (ListBox);
IMPL_GET_WINDOW (ListBox);
-IMPL_IMPL (MultiListBox, ListBox)
-IMPL_CONSTRUCTORS_BODY( MultiListBox, ListBox, "multilistbox", GetMultiListBox()->EnableMultiSelection( true ); );
-IMPL_GET_IMPL( MultiListBox );
-IMPL_GET_WINDOW( MultiListBox );
} // namespace layout
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/source/layout/vcl/wrapper.cxx b/toolkit/source/layout/vcl/wrapper.cxx
index 9713e04b3e40..b175ea2be0b9 100644
--- a/toolkit/source/layout/vcl/wrapper.cxx
+++ b/toolkit/source/layout/vcl/wrapper.cxx
@@ -115,10 +115,6 @@ public:
{
mxTopLevel = xToplevel;
}
- PeerHandle getRoot()
- {
- return mxRoot;
- }
};
Context::Context( const char *pPath )
@@ -131,20 +127,6 @@ Context::~Context()
pImpl = NULL;
}
-void Context::setToplevel( PeerHandle xToplevel )
-{
- pImpl->setTopLevel( xToplevel );
-}
-
-PeerHandle Context::getToplevel()
-{
- return pImpl->getTopLevel();
-}
-PeerHandle Context::getRoot()
-{
- return pImpl->getRoot();
-}
-
PeerHandle Context::GetPeerHandle( const char *id, sal_uInt32 nId ) const
{
PeerHandle xHandle;
@@ -558,22 +540,12 @@ void SAL_CALL ControlImpl::focusLost (awt::FocusEvent const&)
mLoseFocusHdl.Call (mpWindow);
}
-Link& Control::GetGetFocusHdl ()
-{
- return getImpl ().GetGetFocusHdl ();
-}
-
void Control::SetGetFocusHdl (Link const& link)
{
if (&getImpl () && getImpl().mxWindow.is ())
getImpl ().SetGetFocusHdl (link);
}
-Link& Control::GetLoseFocusHdl ()
-{
- return getImpl ().GetLoseFocusHdl ();
-}
-
void Control::SetLoseFocusHdl (Link const& link)
{
if (&getImpl () && getImpl().mxWindow.is ())
@@ -593,15 +565,6 @@ DialogImpl::DialogImpl( Context *context, const PeerHandle &peer, Window *window
{
}
-Dialog::Dialog( Window *parent, const char *xml_file, const char *id, sal_uInt32 nId )
- : Context( xml_file )
- , Window( new DialogImpl( this, Context::GetPeerHandle( id, nId ), this ) )
- , bConstruct (true)
-{
- if ( parent )
- SetParent( parent );
-}
-
Dialog::Dialog( ::Window *parent, const char *xml_file, const char *id, sal_uInt32 nId )
: Context( xml_file )
, Window( new DialogImpl( this, Context::GetPeerHandle( id, nId ), this ) )
@@ -631,31 +594,11 @@ void Dialog::EndDialog( long result )
MX_DIALOG->endDialog (result);
}
-void Dialog::SetText( OUString const& str )
-{
- SetTitle (str);
-}
-
void Dialog::SetTitle( OUString const& str )
{
MX_DIALOG->setTitle (str);
}
-bool Dialog::Close ()
-{
- EndDialog (false);
- return true;
-}
-
-long Dialog::Notify (NotifyEvent& event)
-{
- return GetDialog ()->Notify (event);
-}
-
-void Dialog::Initialize (SfxChildWinInfo*)
-{
-}
-
#define MESSAGE_BOX_MEMBER_INIT\
Dialog (parent, xml_file, id)\
, imageError (this, "FI_ERROR")\
@@ -809,8 +752,6 @@ void MessageBox::init (OUString const& message, OUString const& yes, OUString co
MESSAGE_BOX_IMPL (Error);
MESSAGE_BOX_IMPL (Info);
-MESSAGE_BOX_IMPL (Query);
-MESSAGE_BOX_IMPL (Warning);
class TabControlImpl
: public ControlImpl
@@ -834,11 +775,6 @@ public:
mxTabControl.clear ();
}
- Link& GetActivatePageHdl ()
- {
- return mActivatePageHdl;
- }
-
void SetActivatePageHdl (Link const& link)
{
if (!mDeactivatePageHdl || !link)
@@ -846,11 +782,6 @@ public:
mActivatePageHdl = link;
}
- Link& GetDeactivatePageHdl ()
- {
- return mDeactivatePageHdl;
- }
-
void SetDeactivatePageHdl (Link const& link)
{
if (!mActivatePageHdl || !link)
@@ -895,7 +826,6 @@ public:
};
IMPL_GET_WINDOW (TabControl);
-IMPL_GET_LAYOUT_VCLXWINDOW (TabControl);
#define MX_TABCONTROL if (getImpl ().mxTabControl.is ()) getImpl ().mxTabControl
#define RETURN_MX_TABCONTROL if (getImpl ().mxTabControl.is ()) return getImpl ().mxTabControl
@@ -906,92 +836,22 @@ TabControl::~TabControl ()
SetDeactivatePageHdl (Link ());
}
-void TabControl::InsertPage (sal_uInt16 id, OUString const& title, sal_uInt16 pos)
-{
- (void) pos;
-
- MX_TABCONTROL->insertTab ();
- SetCurPageId (id);
-
-#if 1 // colour me loc productive -- NOT
-#define ADD_PROP( seq, i, name, val )\
- { \
- beans::NamedValue value; \
- value.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( name ) ); \
- value.Value = uno::makeAny( val ); \
- seq[i] = value; \
- }
-
- uno::Sequence< beans::NamedValue > seq (1);
- ADD_PROP ( seq, 0, "Title", OUString (title) );
- MX_TABCONTROL->setTabProps (id, seq);
-#else
- GetTabPage (id)->SetText (title);
-#endif
-}
-void TabControl::RemovePage (sal_uInt16 id)
-{
- GetTabControl ()->RemovePage (id);
-}
-sal_uInt16 TabControl::GetPageCount () const
-{
- return GetTabControl ()->GetPageCount ();
-}
-sal_uInt16 TabControl::GetPageId (sal_uInt16 pos) const
-{
- return GetTabControl ()->GetPageId (pos);
-}
-sal_uInt16 TabControl::GetPagePos (sal_uInt16 id) const
-{
- getImpl ().redraw ();
- return GetTabControl ()->GetPagePos (id);
-}
void TabControl::SetCurPageId (sal_uInt16 id)
{
getImpl ().redraw ();
GetTabControl ()->SetCurPageId (id);
}
-sal_uInt16 TabControl::GetCurPageId () const
-{
- return GetTabControl ()->GetCurPageId ();
-}
-void TabControl::SetTabPage (sal_uInt16 id, ::TabPage* page)
-{
- GetTabControl ()->SetTabPage (id, page);
- getImpl ().redraw ();
-}
-::TabPage* TabControl::GetTabPage (sal_uInt16 id) const
-{
- return GetTabControl ()->GetTabPage (id);
-}
void TabControl::SetActivatePageHdl (Link const& link)
{
if (&getImpl () && getImpl().mxTabControl.is ())
getImpl ().SetActivatePageHdl (link);
}
-Link& TabControl::GetActivatePageHdl () const
-{
- return getImpl ().GetActivatePageHdl ();
-}
void TabControl::SetDeactivatePageHdl (Link const& link)
{
if (&getImpl () && getImpl().mxTabControl.is ())
getImpl ().SetDeactivatePageHdl (link);
}
-Link& TabControl::GetDeactivatePageHdl () const
-{
- return getImpl ().GetDeactivatePageHdl ();
-}
-void TabControl::SetTabPageSizePixel (Size const& size)
-{
- GetTabControl ()->SetTabPageSizePixel (size);
-}
-Size TabControl::GetTabPageSizePixel () const
-{
- return GetTabControl ()->GetTabPageSizePixel ();
-}
-IMPL_CONSTRUCTORS (TabControl, Control, "tabcontrol");
IMPL_GET_IMPL (TabControl);
class TabPageImpl : public WindowImpl
@@ -1010,22 +870,6 @@ TabControl* TabPage::global_tabcontrol = 0;
IMPL_GET_IMPL( TabPage );
-TabPage::TabPage( Window *parent, const char *xml_file, const char *id, sal_uInt32 nId)
- : Context( xml_file )
- , Window( new TabPageImpl( this, Context::GetPeerHandle( id, nId ), this ) )
-{
- if ( parent )
- SetParent( parent );
-}
-
-TabPage::TabPage( ::Window *parent, const char *xml_file, const char *id, sal_uInt32 nId)
- : Context( xml_file )
- , Window( new TabPageImpl( this, Context::GetPeerHandle( id, nId ), this ) )
-{
- if ( parent )
- SetParent( parent );
-}
-
TabPage::~TabPage()
{
delete GetTabPage();
@@ -1041,24 +885,6 @@ void TabPage::DeactivatePage()
{
}
-class FixedLineImpl : public ControlImpl
-{
-public:
- FixedLineImpl( Context *context, const PeerHandle &peer, Window *window )
- : ControlImpl( context, peer, window )
- {
- }
-};
-
-IMPL_CONSTRUCTORS( FixedLine, Control, "hfixedline" );
-IMPL_GET_IMPL( FixedLine );
-
-bool FixedLine::IsEnabled() const
-{
- //FIXME
- return true;
-}
-
class FixedTextImpl : public ControlImpl
{
public:
@@ -1086,11 +912,18 @@ void SAL_CALL FixedTextImpl::disposing( lang::EventObject const& e )
mxFixedText.clear ();
}
+FixedText::FixedText ( Context *context, char const* pId, sal_uInt32 nId )
+ : Control( new FixedTextImpl( context, context->GetPeerHandle( pId, nId ), this ) )
+{
+ Window *parent = dynamic_cast<Window*> (context);
+ if (parent)
+ SetParent (parent);
+}
+
FixedText::~FixedText ()
{
}
-IMPL_CONSTRUCTORS( FixedText, Control, "fixedtext" );
IMPL_GET_IMPL( FixedText );
void FixedText::SetText( OUString const& rStr )
@@ -1100,18 +933,6 @@ void FixedText::SetText( OUString const& rStr )
getImpl().mxFixedText->setText( rStr );
}
-class FixedInfoImpl : public FixedTextImpl
-{
-public:
- FixedInfoImpl( Context *context, const PeerHandle &peer, Window *window )
- : FixedTextImpl( context, peer, window )
- {
- }
-};
-
-IMPL_CONSTRUCTORS( FixedInfo, FixedText, "fixedinfo" );
-IMPL_GET_IMPL( FixedInfo );
-
class ProgressBarImpl : public ControlImpl
{
public:
@@ -1146,217 +967,15 @@ public:
}
};
-IMPL_CONSTRUCTORS( FixedImage, Control, "fixedimage" );
-IMPL_GET_IMPL( FixedImage )
-
-void FixedImage::setImage( ::Image const& i )
-{
- (void) i;
- if ( !getImpl().mxGraphic.is() )
- return;
- //FIXME: hack moved to proplist
- //getImpl().mxGraphic =
-}
-
-
-IMPL_CONSTRUCTORS( ProgressBar, Control, "ProgressBar" );
-IMPL_GET_IMPL( ProgressBar );
-
-void ProgressBar::SetForegroundColor( util::Color color )
-{
- if ( !getImpl().mxProgressBar.is() )
- return;
- getImpl().mxProgressBar->setForegroundColor( color );
-}
-
-void ProgressBar::SetBackgroundColor( util::Color color )
-{
- if ( !getImpl().mxProgressBar.is() )
- return;
- getImpl().mxProgressBar->setBackgroundColor( color );
-}
-
-void ProgressBar::SetValue( sal_Int32 i )
-{
- if ( !getImpl().mxProgressBar.is() )
- return;
- getImpl().mxProgressBar->setValue( i );
-}
-
-void ProgressBar::SetRange( sal_Int32 min, sal_Int32 max )
-{
- if ( !getImpl().mxProgressBar.is() )
- return;
- getImpl().mxProgressBar->setRange( min, max );
-}
-
-sal_Int32 ProgressBar::GetValue()
-{
- if ( !getImpl().mxProgressBar.is() )
- return 0;
- return getImpl().mxProgressBar->getValue();
-}
-
-class PluginImpl: public ControlImpl
-{
-public:
- ::Control *mpPlugin;
-
- PluginImpl( Context *context, const PeerHandle &peer, Window *window, :: Control *plugin )
- : ControlImpl( context, peer, window )
- , mpPlugin( plugin )
- {
- uno::Reference <awt::XWindow> ref( mxWindow, uno::UNO_QUERY );
- layoutimpl::VCLXPlugin *vcl
- = static_cast<layoutimpl::VCLXPlugin*>( VCLXWindow::GetImplementation( ref ) );
- ::Window *parent = vcl->mpWindow->GetParent();
- vcl->SetWindow( plugin );
- vcl->SetPlugin( mpPlugin );
- plugin->SetParent( parent );
- plugin->SetStyle( vcl->mStyle );
- plugin->SetCreatedWithToolkit( true );
- plugin->SetComponentInterface( vcl );
- plugin->Show();
- }
-};
-
-Plugin::Plugin( Context *context, char const *id, ::Control *plugin )
- : Control( new PluginImpl( context, context->GetPeerHandle( id, 0 ), this, plugin ) )
- , mpPlugin( plugin )
-{
-}
-
-IMPL_GET_IMPL( Plugin );
-
-class LocalizedStringImpl : public WindowImpl
-{
-public:
- layoutimpl::LocalizedString *mpString;
- OUString maString;
- LocalizedStringImpl( Context *context, const PeerHandle &peer, Window *window )
- : WindowImpl( context, peer, window )
- , mpString( static_cast<layoutimpl::LocalizedString*>( VCLXWindow::GetImplementation( uno::Reference <awt::XWindow> ( mxWindow, uno::UNO_QUERY ) ) ) )
- , maString ()
- {
- }
- OUString getText()
- {
- if (mpString)
- maString = mpString->getText ();
- return maString;
- }
- void setText( OUString const& s )
- {
- if (mpString)
- mpString->setText( s );
- }
-};
-
-IMPL_GET_IMPL( LocalizedString );
-
-LocalizedString::LocalizedString( Context *context, char const* id )
- : Window( new LocalizedStringImpl( context, context->GetPeerHandle( id, 0 ), this ) )
-{
-}
-
-String LocalizedString::getString ()
-{
- return getImpl ().getText ();
-}
-
-OUString LocalizedString::getOUString ()
-{
- return getImpl ().getText ();
-}
-
-LocalizedString::operator OUString ()
-{
- return getOUString ();
-}
-
-LocalizedString::operator OUString const& ()
-{
- getOUString ();
- return getImpl ().maString;
-}
-
-LocalizedString::operator String()
-{
- getOUString ();
- return getImpl ().maString;
-}
-
-String LocalizedString::GetToken (sal_uInt16 i, sal_Char c)
-{
- return getString ().GetToken (i, c);
-}
-
-OUString LocalizedString::operator= (OUString const& s)
-{
- getImpl().setText( s );
- return getImpl().getText();
-}
-
-OUString LocalizedString::operator+= (OUString const& b)
-{
- OUString a = getImpl ().getText ();
- a += b;
- getImpl ().setText (a);
- return getImpl ().getText ();
-}
-
-OUString LocalizedString::operator+= (sal_Unicode const b)
-{
- String a = getImpl ().getText ();
- a += b;
- getImpl ().setText (a);
- return getImpl ().getText ();
-}
-
-class InPlugImpl : public WindowImpl
-{
-public:
- InPlugImpl (Context *context, const PeerHandle &peer, Window *window)
- : WindowImpl (context, peer, window)
- {
- }
-};
-
-IMPL_GET_IMPL (InPlug);
-
-static char const *FIXME_set_parent (::Window *parent, char const *xml_file)
-{
- layout::TabPage::global_parent = parent;
- return xml_file;
-}
-
-InPlug::InPlug (Window *parent, char const* xml_file, char const* id, sal_uInt32 nId)
- : Context (FIXME_set_parent (parent ? parent->GetWindow () : 0, xml_file))
- , layout::Window (new InPlugImpl (this, Context::GetPeerHandle (id, nId), this))
+FixedImage::FixedImage ( Context *context, char const* pId, sal_uInt32 nId )
+ : Control( new FixedImageImpl( context, context->GetPeerHandle( pId, nId ), this ) )
{
+ Window *parent = dynamic_cast<Window*> (context);
if (parent)
SetParent (parent);
- if (::Window *w = dynamic_cast< ::Window* > (this))
- w->SetComponentInterface (GetVCLXWindow ());
-}
-
-InPlug::InPlug (::Window *parent, char const* xml_file, char const* id, sal_uInt32 nId)
- : Context (FIXME_set_parent (parent, xml_file))
- , layout::Window (new InPlugImpl (this, Context::GetPeerHandle (id, nId), this))
-{
- if (parent)
- layout::Window::SetParent (parent);
- if (::Window *w = dynamic_cast< ::Window* > (this))
- w->SetComponentInterface (GetVCLXWindow ());
}
-void InPlug::ParentSet (Window *window)
-{
- window->SetParent (dynamic_cast< ::Window* > (this));
-
- /// FIXME: for standalone run of layout::SfxTabDialog
- SetParent (window->GetParent ());
-}
+IMPL_GET_IMPL( FixedImage )
} // namespace layout
diff --git a/toolkit/workben/controls.cxx b/toolkit/workben/controls.cxx
deleted file mode 100644
index 93b68649db82..000000000000
--- a/toolkit/workben/controls.cxx
+++ /dev/null
@@ -1,272 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_toolkit.hxx"
-#include <tools/debug.hxx>
-
-#include <vcl/window.hxx>
-#include <vcl/svapp.hxx>
-#include <vcl/wrkwin.hxx>
-#include <vcl/msgbox.hxx>
-
-
-#include <stardiv/uno/awt/window.hxx>
-#include <stardiv/uno/awt/vclwin.hxx>
-#include <stardiv/uno/awt/printer.hxx>
-#include <stardiv/uno/repos/serinfo.hxx>
-#include <stardiv/uno/lang/factory.hxx>
-
-
-#include <unoctrl.hxx>
-
-#include <svtools/unoiface.hxx> // InitExtToolkit
-
-UsrAny UsrAny_UINT16( UINT16 n )
-{
- UsrAny aVal;
- aVal.setUINT16( n );
- return aVal;
-}
-
-// -----------------------------------------------------------------------
-
-class MyApp : public Application
-{
-public:
- void Main();
-};
-
-MyApp aMyApp;
-
-// -----------------------------------------------------------------------
-
-class MyWin : public WorkWindow
-{
- XControlRef xCtrl;
- XPropertySetRef xCtrlModel;
- XControlContainerRef xCont;
- XPropertySetRef xContModel;
- XControlRef xDrawCtrl;
- XGraphicsRef xG;
-
-public:
- MyWin( Window* pParent, WinBits nWinStyle );
- ~MyWin();
-
- void MouseButtonDown( const MouseEvent& rMEvt );
- void Resize();
- void Paint( const Rectangle& r );
-};
-
-// -----------------------------------------------------------------------
-
-void MyApp::Main()
-{
- createAndSetDefaultServiceManager();
-
- MyWin aMainWin( NULL, WB_APP | WB_STDWORK );
- aMainWin.SetText( "Uno-Controls - Workbench" );
- aMainWin.Show();
- Execute();
-}
-
-// -----------------------------------------------------------------------
-
-MyWin::MyWin( Window* pParent, WinBits nWinStyle ) :
- WorkWindow( pParent, nWinStyle )
-{
-}
-
-// -----------------------------------------------------------------------
-MyWin::~MyWin()
-{
- XComponentRef xC1( xCont, USR_QUERY );
- xC1->dispose();
- XComponentRef xC2( xContModel, USR_QUERY );
- xC2->dispose();
-}
-
-// -----------------------------------------------------------------------
-
-void MyWin::MouseButtonDown( const MouseEvent& rMEvt )
-{
- if( rMEvt.GetClicks() == 2 )
- {
- XViewRef xV( xDrawCtrl, USR_QUERY );
- XWindowRef xC( xDrawCtrl, USR_QUERY );
- xV->draw( xC->getPosSize().Left(), xC->getPosSize().Top() );
- }
- else if( rMEvt.GetClicks() == 1 )
- {
- if( xContModel )
- {
- static INT32 nColor = 0x001788ab;
- xContModel->setPropertyValue( L"BackgroundColor", UsrAny( nColor ) );
- nColor += 0x00111111;
- nColor &= 0xFFFFFF;
- }
- else
- {
- XServiceManagerRef xProv = getGlobalServiceManager();
-
- XMultiServiceFactoryRef xMSF = NAMESPACE_USR( getProcessServiceManager )();
-
- XServiceProviderRef xSSI = xProv->queryServiceProvider( L"stardiv.vcl.VclToolkit" );
- XToolkitRef xToolkit( xMSF->createInstance( L"stardiv.vcl.VclToolkit" ), USR_QUERY );
- DBG_ASSERT( xToolkit, "No Toolkit!" );
-
- // Uno Container + Model erzeugen
- XServiceProviderRef xModelProv; // = xProv->queryServiceProvider( L"stardiv.vcl.controlmodel.ControlContainer" );
- XInterfaceRef xCMRef( xMSF->createInstance(L"stardiv.vcl.controlmodel.ControlContainer") );
- xCMRef->queryInterface( XPropertySet::getSmartUik(), xContModel );
- xContModel->setPropertyValue( L"Border", UsrAny_UINT16( 1 ) );
- xContModel->setPropertyValue( L"BackgroundColor", UsrAny( (UINT32)0x00CCCCCC) );
-
- xModelProv = xProv->queryServiceProvider( L"stardiv.vcl.control.ControlContainer" );
- XInterfaceRef xCCRef( xModelProv->createInstance(), USR_QUERY );
- xCCRef->queryInterface( XControlContainer::getSmartUik(), xCont );
-
- XControlModelRef xCM( xContModel, USR_QUERY );
- XControlRef xContControl( xCont, USR_QUERY );
- xContControl->setModel( xCM );
- XWindowRef xContComp( xCont, USR_QUERY );
- xContComp->setPosSize( 0, 0, 500, 600, PosSize_POSSIZE );
-
- // Zwei EditControls auf einem Model...
-// xModelProv = xProv->queryServiceProvider( L"stardiv.uno.awt.UnoControlEditModel" );
- XInterfaceRef xModel( xMSF->createInstance(L"stardiv.uno.awt.UnoControlEditModel") );
- DBG_ASSERT( xModel, "No Model!" );
-
- XPropertySetRef xPSet( xModel, USR_QUERY );
- xPSet->setPropertyValue( L"Text", UsrAny( UString( L"Hallo!" ) ) );
- xPSet->setPropertyValue( L"FontName", UsrAny( UString( L"Times New Roman" ) ) );
-// xPSet->setPropertyValue( L"FontWeight", UsrAny( 200 ) );
-
- XServiceProviderRef xEditCtrlProv = xProv->queryServiceProvider( L"stardiv.uno.awt.UnoControlEdit" );
- // Edit1
- XControlRef xEdit1( xMSF->createInstance(L"stardiv.uno.awt.UnoControlEdit"), USR_QUERY );
- xModel->queryInterface( XControlModel::getSmartUik(), xCM );
- xEdit1->setModel( xCM );
- XWindowRef xEditCmp1( xEdit1, USR_QUERY );
- xEditCmp1->setPosSize( 50, 50, 100, 60, PosSize_POSSIZE );
- xCont->addControl( L"", xEdit1 );
- // Edit2
- XControlRef xEdit2( xMSF->createInstance(L"stardiv.uno.awt.UnoControlEdit"), USR_QUERY );
- xModel->queryInterface( XControlModel::getSmartUik(), xCM );
- xEdit2->setModel( xCM );
- XWindowRef xEditCmp2( xEdit2, USR_QUERY );
- XLayoutConstrainsRef xL( xEdit2, USR_QUERY );
- if ( xL.is() )
- {
- Size aSz = xL->getPreferredSize();
- xEditCmp2->setPosSize( 100, 180, aSz.Width(), aSz.Height(), PosSize_POSSIZE );
- }
- else
- xEditCmp2->setPosSize( 100, 180, 100, 40, PosSize_POSSIZE );
- xCont->addControl( L"", xEdit2 );
-
- xModelProv = xProv->queryServiceProvider( L"stardiv.vcl.controlmodel.NumericField" );
- XInterfaceRef xNumModel( xModelProv->createInstance(), USR_QUERY );
- DBG_ASSERT( xNumModel, "No Model!" );
-
-
- XServiceProviderRef xNumFieldProv = xProv->queryServiceProvider( L"stardiv.vcl.control.NumericField" );
- XControlRef xNumField( xNumFieldProv->createInstance(), USR_QUERY );
- xNumModel->queryInterface( XControlModel::getSmartUik(), xCM );
- xNumField->setModel( xCM );
- XWindowRef xNumFieldWin( xNumField, USR_QUERY );
- xNumFieldWin->setPosSize( 50, 250, 100, 60, PosSize_POSSIZE );
- xCont->addControl( L"", xNumField );
-
- XMultiPropertySetRef xPSet2( xNumModel, USR_QUERY );
- Sequence<UString> Names( 2 );
- Names.getArray()[0] = L"Value";
- Names.getArray()[1] = L"ValueMin";
- Sequence<UsrAny> Values( 2 );
- Values.getArray()[0] = UsrAny( -2000000.0 );
- Values.getArray()[1] = UsrAny( -2000000.0 );
- xPSet2->setPropertyValues( Names, Values );
-
-
- // Button...
- xModelProv = xProv->queryServiceProvider( L"stardiv.vcl.controlmodel.Button" );
- xModelProv->createInstance()->queryInterface( XInterface::getSmartUik(), xModel );
- DBG_ASSERT( xModel, "No Model!" );
-
- xModel->queryInterface( XPropertySet::getSmartUik(), xPSet );
- xPSet->setPropertyValue( L"Label", UsrAny( L"Press!" ) );
-
- XServiceProviderRef xButtonCtrlProv = xProv->queryServiceProvider( L"stardiv.vcl.control.Button" );
- XControlRef xButton1( xButtonCtrlProv->createInstance(), USR_QUERY );
- xModel->queryInterface( XControlModel::getSmartUik(), xCM );
- xButton1->setModel( xCM );
- XWindowRef xButtonCmp1( xButton1, USR_QUERY );
- xButtonCmp1->setPosSize( 170, 80, 80, 80, PosSize_POSSIZE );
- // Unsichtbar, nur im MBDown mit DrawRoutine bei Doppel-Klick...
- xButtonCmp1->setVisible( FALSE );
- xDrawCtrl = xButton1;
-
- xCont->addControl( L"", xButton1 );
-
- // Container anzeigen...
- // Als Child zu diesem Fenster
- xContControl->createPeer( XToolkitRef(), GetComponentInterface( TRUE ) );
-
- XDeviceRef xD( xContControl->getPeer(), USR_QUERY );
- xG = xD->createGraphics();
- XViewRef xV ( xDrawCtrl, USR_QUERY );
- xV->setGraphics( xG );
-
- }
- return;
- }
- WorkWindow::MouseButtonDown( rMEvt );
-}
-
-
-// -----------------------------------------------------------------------
-
-void MyWin::Resize()
-{
- WorkWindow::Resize();
-}
-
-void MyWin::Paint( const Rectangle& r )
-{
- // Muss ueber PaintListener geschehen...
- if ( xDrawCtrl.is() )
- {
- XViewRef xV( xDrawCtrl, USR_QUERY );
- XWindowRef xC( xDrawCtrl, USR_QUERY );
- xV->draw( xC->getPosSize().Left(), xC->getPosSize().Top() );
- }
-
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/workben/layout/.gitignore b/toolkit/workben/layout/.gitignore
deleted file mode 100644
index 142ba57c1444..000000000000
--- a/toolkit/workben/layout/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-/de
-/en-US
-/nl
-/ja \ No newline at end of file
diff --git a/toolkit/workben/layout/README b/toolkit/workben/layout/README
deleted file mode 100644
index 3ab112e50ff2..000000000000
--- a/toolkit/workben/layout/README
+++ /dev/null
@@ -1,43 +0,0 @@
-Testing workbench and editor for Layout engine.
-
-* Configure using --enable-layout.
-
-* [d]make all
-
-* export OOO_INSTALL_PREFIX=$(pwd)/ooo-layout
-
-* [d]make install DESTDIR=$OOO_INSTALL_PREFIX
-
-* Compile test program in toolkit/workben/layout
-
- cd toolkit/workben/layout && dmake all
-
-* FIXME: New three layer install/rpath feature needs these workarounds
-|
-| test -d $OOO_INSTALL_PREFIX/openoffice.org3 && export OOO_PREFIX_BRAND=$OOO_INSTALL_PREFIX/openoffice.org3 || export OOO_PREFIX_BRAND=$OOO_INSTALL_PREFIX
-| cp -f ../..$INPATH/lib/libtkx.so $OOO_PREFIX/openoffice.org/program
-| export LD_LIBRARY_PATH=$OOO_PREFIX_BRAND/program:$OOO_PREFIX_BRAND/ure-link/lib
-|
-| (see source/layout/helper.cxx)
-
-* Run it on any .xml file
-
- ../../$INPATH/bin/test [--inst $OOO_INSTALL_PREFIX] zoom.xml
-
-* Run it for specific dialogs, see test.cxx
-
- ../../$INPATH/bin/test [--inst $OOO_INSTALL_PREFIX] --test zoom
- ../../$INPATH/bin/test [--inst $OOO_INSTALL_PREFIX] --test wordcount
-
-* Or source refresh in workben/layout, do something like
-
- cd toolkit/workben/layout && . ./refresh [--inst $OOO_INSTALL_PREFIX]
-
-Integration into OOo:
-
-* After instaling, run
-
- cd ooo-cvs/program
- ./soffice.bin
-
- Start a [Writer] document and choose View/Zoom or Extra/Word count.
diff --git a/toolkit/workben/layout/TEST b/toolkit/workben/layout/TEST
deleted file mode 100755
index e1376e1f2867..000000000000
--- a/toolkit/workben/layout/TEST
+++ /dev/null
@@ -1,11 +0,0 @@
-#! /bin/sh
-for d in $(cd ../../../../.. && pwd)/ooo-svn /usr/lib/ooo3/; do
- if test -d $d; then
- export OOO_INSTALL_PREFIX=$d
- break
- fi
-done
-export SAL_ALLOW_LINKOO_SYMLINKS=1
-test -d $OOO_INSTALL_PREFIX/openoffice.org3 && export OOO_PREFIX_BRAND=$OOO_INSTALL_PREFIX/openoffice.org3 || export OOO_PREFIX_BRAND=$OOO_INSTALL_PREFIX
-export LD_LIBRARY_PATH="$OOO_PREFIX_BRAND/program:$OOO_PREFIX_BRAND/ure-link/lib"
-../../unx*.pro/bin/test "$@"
diff --git a/toolkit/workben/layout/adjust.xml b/toolkit/workben/layout/adjust.xml
deleted file mode 100644
index 186a94bf5e6a..000000000000
--- a/toolkit/workben/layout/adjust.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<dialog xmlns="http://openoffice.org/2007/layout"
- id="window1" title="Text Editor" optimumsize="true"
- has_border="true" sizeable="true" moveable="true">
- <vbox>
- <!-- Ver Top -->
- <hbox>
- <align v-align="0" h-align="0" v-fill="0" h-fill="0">
- <pushbutton label="Top Left" />
- </align>
- <align>
- <pushbutton label="Top Middle" v-align="0" h-align="0.5" v-fill="0" h-fill="0" />
- </align>
- <align>
- <pushbutton label="Top Right" v-align="0" h-align="1" v-fill="0" h-fill="0" />
- </align>
- </hbox>
- <!-- Ver Middle -->
- <hbox>
- <align>
- <pushbutton label="Middle Left" v-align="0.5" h-align="0" v-fill="0" h-fill="0" />
- </align>
- <align>
- <pushbutton label="Middle Middle" v-align="0.5" h-align="0.5" v-fill="0" h-fill="0" />
- </align>
- <align>
- <pushbutton label="Middle Right" v-align="0.5" h-align="1" v-fill="0" h-fill="0" />
- </align>
- </hbox>
- <!-- Ver Bottom -->
- <hbox>
- <align>
- <pushbutton label="Bottom Left" v-align="1" h-align="0" v-fill="0" h-fill="0" />
- </align>
- <align>
- <pushbutton label="Bottom Middle" v-align="1" h-align="0.5" v-fill="0" h-fill="0" />
- </align>
- <align>
- <pushbutton label="Bottom Right" v-align="1" h-align="1" v-fill="0" h-fill="0" />
- </align>
- </hbox>
- </vbox>
-</dialog>
diff --git a/toolkit/workben/layout/align-test.xml b/toolkit/workben/layout/align-test.xml
deleted file mode 100644
index 60c34b4655a5..000000000000
--- a/toolkit/workben/layout/align-test.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- This is a template. i18n translation is not performed in-place;
- i18n translated xml files are generated from this template by
- transex3/layout/tralay. !-->
-
-<dialog xmlns="http://openoffice.org/2007/layout"
- xmlns:cnt="http://openoffice.org/2007/layout/container"
- title="Align Test" optimumsize="true" has_border="true" sizeable="true" moveable="true">
- <vbox spacing="5" border="5">
- <fixedline/>
- <hbox spacing="0" border="0">
- <vbox spacing="5" border="5">
- <fixedline _text="X" cnt:expand="false"/>
- <pushbutton label="foo"/>
- <pushbutton label="foo"/>
- <pushbutton label="foo"/>
- <pushbutton label="foo"/>
- <pushbutton label="foo"/>
- <pushbutton label="foo"/>
- <pushbutton label="foo"/>
- </vbox>
- <vbox spacing="5" border="5">
- <fixedline _text="X" cnt:expand="false"/>
- <pushbutton label="bar"/>
- </vbox>
- </hbox>
- <fixedline/>
- <min-size cnt:spacing="0" min-width="200"/>
- </vbox>
-</dialog>
diff --git a/toolkit/workben/layout/align.xml b/toolkit/workben/layout/align.xml
deleted file mode 100644
index 85aee220fc78..000000000000
--- a/toolkit/workben/layout/align.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<dialog xmlns="http://openoffice.org/2007/layout"
- xmlns:cnt="http://openoffice.org/2007/layout/container"
- title="Align Test" optimumsize="true" has_border="true" sizeable="true" moveable="true">
- <vbox>
- <!-- Ver Top -->
- <hbox>
- <align halign="0" valign="0">
- <pushbutton label="Top Left" />
- </align>
- <align halign="0.5" valign="0">
- <pushbutton label="Top Middle" />
- </align>
- <align halign="1" valign="0">
- <pushbutton label="Top Right" />
- </align>
- </hbox>
- <!-- Ver Middle -->
- <hbox>
- <align halign="0" valign="0.5">
- <pushbutton label="Middle Left" />
- </align>
- <align halign="0.5" valign="0.5">
- <pushbutton label="Middle Middle" />
- </align>
- <align halign="1" valign="0.5">
- <pushbutton label="Middle Right" />
- </align>
- </hbox>
- <!-- Ver Bottom -->
- <hbox>
- <align halign="0" valign="1">
- <pushbutton label="Bottom Left" />
- </align>
- <align halign="0.5" valign="1">
- <pushbutton label="Bottom Middle" />
- </align>
- <align halign="1" valign="1">
- <pushbutton label="Bottom Right" />
- </align>
- </hbox>
- </vbox>
-</dialog>
diff --git a/toolkit/workben/layout/boxtest.xml b/toolkit/workben/layout/boxtest.xml
deleted file mode 100644
index 24ead837c057..000000000000
--- a/toolkit/workben/layout/boxtest.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<dialog xmlns="http://openoffice.org/2007/layout"
- xmlns:cnt="http://openoffice.org/2007/layout/container"
- title="Box Test" optimumsize="true" has_border="true" sizeable="true" moveable="true">
- <vbox>
- <table>
- <vbox>
- <hbox cnt:expand="false" cnt:fill="false">
- <pushbutton label="XML Left"
- cnt:expand="false" cnt:fill="false"/>
- <pushbutton label="XML Middle"
- cnt:expand="true" cnt:fill="false"/>
- <pushbutton label="XML Right"
- cnt:expand="true" cnt:fill="true"/>
- </hbox>
- <hbox cnt:expand="true" cnt:fill="false">
- <pushbutton label="XML Left"
- cnt:expand="false" cnt:fill="false"/>
- <pushbutton label="XML Middle"
- cnt:expand="true" cnt:fill="false"/>
- <pushbutton label="XML Right"
- cnt:expand="true" cnt:fill="true"/>
- </hbox>
- <hbox cnt:expand="true" cnt:fill="true">
- <pushbutton label="XML Left"
- cnt:expand="false" cnt:fill="false"/>
- <pushbutton label="XML Middle"
- cnt:expand="true" cnt:fill="false"/>
- <pushbutton label="XML Right"
- cnt:expand="true" cnt:fill="true"/>
- </hbox>
- </vbox>
- </table>
- </vbox>
-</dialog>
diff --git a/toolkit/workben/layout/dialogbuttons-ok.xml b/toolkit/workben/layout/dialogbuttons-ok.xml
deleted file mode 100644
index 86c7a1b13818..000000000000
--- a/toolkit/workben/layout/dialogbuttons-ok.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<modaldialog xmlns="http://openoffice.org/2007/layout"
- xmlns:cnt="http://openoffice.org/2007/layout/container"
- id="dialog" title="Dialog Button Ordering" optimumsize="true"
- has_border="true" sizeable="true" moveable="true">
- <vbox border="5" spacing="5">
- <fixedline text="Platform default"/>
- <dialogbuttonhbox border="5" spacing="5">
- <flow/>
- <okbutton/>
- <cancelbutton/>
- <helpbutton/>
- <nobutton label="~Alternate"/>
- </dialogbuttonhbox>
- <fixedline text="GNOME"/>
- <dialogbuttonhbox border="5" spacing="5" ordering="gnome">
- <flow/>
- <okbutton/>
- <cancelbutton/>
- <helpbutton/>
- <nobutton label="~Alternate"/>
- </dialogbuttonhbox>
- <fixedline text="KDE"/>
- <dialogbuttonhbox border="5" spacing="5" ordering="kde">
- <flow/>
- <okbutton/>
- <cancelbutton/>
- <helpbutton/>
- <nobutton label="~Alternate"/>
- </dialogbuttonhbox>
- <fixedline text="MacOS"/>
- <dialogbuttonhbox border="5" spacing="5" ordering="macos">
- <flow/>
- <okbutton/>
- <cancelbutton/>
- <helpbutton/>
- <nobutton label="~Alternate"/>
- </dialogbuttonhbox>
- <fixedline text="Windows"/>
- <dialogbuttonhbox border="5" spacing="5" ordering="windows">
- <flow/>
- <okbutton/>
- <cancelbutton/>
- <helpbutton/>
- <nobutton label="~Alternate"/>
- </dialogbuttonhbox>
- </vbox>
-</modaldialog>
diff --git a/toolkit/workben/layout/dialogbuttons-reset.xml b/toolkit/workben/layout/dialogbuttons-reset.xml
deleted file mode 100644
index 6c1c613fe96d..000000000000
--- a/toolkit/workben/layout/dialogbuttons-reset.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<modaldialog xmlns="http://openoffice.org/2007/layout"
- xmlns:cnt="http://openoffice.org/2007/layout/container"
- id="dialog" title="Dialog Button Ordering" optimumsize="true"
- has_border="true" sizeable="true" moveable="true">
- <vbox border="5" spacing="5">
- <fixedline text="Platform default"/>
- <dialogbuttonhbox border="5" spacing="5">
- <flow/>
- <okbutton/>
- <cancelbutton/>
- <helpbutton/>
- <nobutton label="~Alternate"/>
- <resetbutton/>
- </dialogbuttonhbox>
- <fixedline text="GNOME"/>
- <dialogbuttonhbox border="5" spacing="5" ordering="gnome">
- <flow/>
- <okbutton/>
- <cancelbutton/>
- <helpbutton/>
- <nobutton label="~Alternate"/>
- <resetbutton/>
- </dialogbuttonhbox>
- <fixedline text="KDE"/>
- <dialogbuttonhbox border="5" spacing="5" ordering="kde">
- <flow/>
- <okbutton/>
- <cancelbutton/>
- <helpbutton/>
- <nobutton label="~Alternate"/>
- <resetbutton/>
- </dialogbuttonhbox>
- <fixedline text="MacOS"/>
- <dialogbuttonhbox border="5" spacing="5" ordering="macos">
- <flow/>
- <okbutton/>
- <cancelbutton/>
- <helpbutton/>
- <nobutton label="~Alternate"/>
- <resetbutton/>
- </dialogbuttonhbox>
- <fixedline text="Windows"/>
- <dialogbuttonhbox border="5" spacing="5" ordering="windows">
- <flow/>
- <okbutton/>
- <cancelbutton/>
- <helpbutton/>
- <nobutton label="~Alternate"/>
- <resetbutton/>
- </dialogbuttonhbox>
- </vbox>
-</modaldialog>
diff --git a/toolkit/workben/layout/dialogbuttons-save.xml b/toolkit/workben/layout/dialogbuttons-save.xml
deleted file mode 100644
index 38bd90773d0e..000000000000
--- a/toolkit/workben/layout/dialogbuttons-save.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<modaldialog xmlns="http://openoffice.org/2007/layout"
- xmlns:cnt="http://openoffice.org/2007/layout/container"
- id="dialog" title="Dialog Button Ordering" optimumsize="true"
- has_border="true" sizeable="true" moveable="true">
- <vbox border="5" spacing="5">
- <fixedline text="Platform default"/>
- <dialogbuttonhbox border="5" spacing="5">
- <flow/>
- <yesbutton label="~Save"/>
- <cancelbutton/>
- <helpbutton/>
- <nobutton label="~Don't save"/>
- </dialogbuttonhbox>
- <fixedline text="GNOME"/>
- <dialogbuttonhbox border="5" spacing="5" ordering="gnome">
- <flow/>
- <yesbutton label="~Save"/>
- <cancelbutton/>
- <helpbutton/>
- <nobutton label="~Don't save"/>
- </dialogbuttonhbox>
- <fixedline text="KDE"/>
- <dialogbuttonhbox border="5" spacing="5" ordering="kde">
- <flow/>
- <yesbutton label="~Save"/>
- <cancelbutton/>
- <helpbutton/>
- <nobutton label="~Don't save"/>
- </dialogbuttonhbox>
- <fixedline text="MacOS"/>
- <dialogbuttonhbox border="5" spacing="5" ordering="macos">
- <flow/>
- <yesbutton label="~Save"/>
- <cancelbutton/>
- <helpbutton/>
- <nobutton label="~Don't save"/>
- </dialogbuttonhbox>
- <fixedline text="Windows"/>
- <dialogbuttonhbox border="5" spacing="5" ordering="windows">
- <flow/>
- <yesbutton label="~Save"/>
- <cancelbutton/>
- <helpbutton/>
- <nobutton label="~Don't save"/>
- </dialogbuttonhbox>
- </vbox>
-</modaldialog>
diff --git a/toolkit/workben/layout/dialogbuttons-yes.xml b/toolkit/workben/layout/dialogbuttons-yes.xml
deleted file mode 100644
index 78845598bffc..000000000000
--- a/toolkit/workben/layout/dialogbuttons-yes.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<modaldialog xmlns="http://openoffice.org/2007/layout"
- xmlns:cnt="http://openoffice.org/2007/layout/container"
- id="dialog" title="Dialog Button Ordering" optimumsize="true"
- has_border="true" sizeable="true" moveable="true">
- <vbox border="5" spacing="5">
- <fixedline text="Platform default"/>
- <dialogbuttonhbox border="5" spacing="5">
- <flow/>
- <yesbutton/>
- <cancelbutton/>
- <helpbutton/>
- <nobutton xlabel="~Alternate"/>
- </dialogbuttonhbox>
- <fixedline text="GNOME"/>
- <dialogbuttonhbox border="5" spacing="5" ordering="gnome">
- <flow/>
- <yesbutton/>
- <cancelbutton/>
- <helpbutton/>
- <nobutton xlabel="~Alternate"/>
- </dialogbuttonhbox>
- <fixedline text="KDE"/>
- <dialogbuttonhbox border="5" spacing="5" ordering="kde">
- <flow/>
- <yesbutton/>
- <cancelbutton/>
- <helpbutton/>
- <nobutton xlabel="~Alternate"/>
- </dialogbuttonhbox>
- <fixedline text="MacOS"/>
- <dialogbuttonhbox border="5" spacing="5" ordering="macos">
- <flow/>
- <yesbutton/>
- <cancelbutton/>
- <helpbutton/>
- <nobutton xlabel="~Alternate"/>
- </dialogbuttonhbox>
- <fixedline text="Windows"/>
- <dialogbuttonhbox border="5" spacing="5" ordering="windows">
- <flow/>
- <yesbutton/>
- <cancelbutton/>
- <helpbutton/>
- <nobutton xlabel="~Alternate"/>
- </dialogbuttonhbox>
- </vbox>
-</modaldialog>
diff --git a/toolkit/workben/layout/editor-normal.xml b/toolkit/workben/layout/editor-normal.xml
deleted file mode 100644
index 7f0dc0b69e74..000000000000
--- a/toolkit/workben/layout/editor-normal.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- Would be cool to have others Editor layouts (e.g. Glade-like with
- a window for each function). -->
-
-<dialog xmlns="http://openoffice.org/2007/layout"
- xmlns:cnt="http://openoffice.org/2007/layout/container"
- id="dialog" title="Layout Editor" sizeable="true" >
- <vbox>
- <hbox>
- <min-size min-width="120" cnt:expand="false">
- <vbox>
- <fixedtext label="Layout:" cnt:expand="false" />
- <hbox>
- <listbox id="layout-tree" has_border="true" />
- <vbox cnt:expand="false">
- <pushbutton id="layout-up-button" cnt:expand="false" />
- <pushbutton id="layout-down-button" cnt:expand="false" />
- <fixedtext cnt:expand="true" />
- <pushbutton id="layout-remove-button" cnt:expand="false" />
- </vbox>
- </hbox>
- </vbox>
- </min-size>
- <min-size min-width="120">
- <vbox>
- <fixedtext label="Preview:" cnt:expand="false" />
- <vbox border="50">
- <bin id="preview-box" />
- </vbox>
- </vbox>
- </min-size>
- <min-size min-width="120" cnt:expand="false">
- <vbox>
- <fixedtext label="Properties:" cnt:expand="false" />
- <table id="properties-box" columns="3" />
- </vbox>
- </min-size>
- </hbox>
- <hfixedline cnt:expand="false" />
- <vbox cnt:expand="false">
- <fixedtext label="Create widgets:" cnt:expand="false" />
- <flow id="create-widget" homogeneous="true" spacing="2" />
- <fixedtext label="Create containers:" cnt:expand="false" />
- <flow id="create-container" homogeneous="true" spacing="2" />
- </vbox>
- <hbox cnt:expand="false">
- <vbox><fixedline /><fixedline /><fixedline /><fixedline /></vbox>
-<!-- <pushbutton id="import-button" label="Import..." cnt:expand="false"/>-->
- <pushbutton id="export-button" label="Export (stdout)" cnt:expand="false"/>
- </hbox>
- </vbox>
-</dialog>
diff --git a/toolkit/workben/layout/editor.cxx b/toolkit/workben/layout/editor.cxx
deleted file mode 100644
index f46afb62dfe1..000000000000
--- a/toolkit/workben/layout/editor.cxx
+++ /dev/null
@@ -1,1856 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "editor.hxx"
-
-#undef NDEBUG
-
-/*
-#include <stdio.h>
-#include <string.h>
-*/
-
-#include <cassert>
-#include <cstdio>
-#include <cstring>
-#include <list>
-#include <vector>
-
-#include <com/sun/star/awt/WindowAttribute.hpp>
-#include <com/sun/star/awt/XLayoutConstrains.hpp>
-#include <com/sun/star/awt/XLayoutContainer.hpp>
-#include <com/sun/star/awt/XToolkit.hpp>
-#include <com/sun/star/awt/XVclWindowPeer.hpp>
-#include <com/sun/star/awt/XWindow.hpp>
-#include <com/sun/star/awt/XWindowPeer.hpp>
-#include <rtl/strbuf.hxx>
-#include <rtl/ustrbuf.hxx>
-#include <toolkit/helper/property.hxx>
-#include <vcl/lstbox.h>
-
-using namespace layout::css;
-
-using rtl::OUString;
-
-// FIXME:
-//#define FILEDLG
-
-#include <layout/core/helper.hxx>
-#include <layout/core/root.hxx>
-#include <layout/core/helper.hxx>
-
-// TODO: automatically generated
-struct WidgetSpec {
- const char *pLabel, *pName, *pIconName;
- bool bIsContainer; };
-static const WidgetSpec WIDGETS_SPECS[] = {
- { "Label", "fixedtext" , "sc_label.png", false },
- { "Button", "pushbutton" , "sc_pushbutton.png", false },
- { "Radio Button", "radiobutton" , "sc_radiobutton.png", false },
- { "Check Box", "checkbox" , "sc_checkbox.png", false },
- { "Line Edit", "edit" , "sc_edit.png", false },
- { "Numeric Field", "numericfield", "sc_numericfield.png", false },
- { "List Box ", "listbox" , NULL, false },
- // containers
- { "Hor Box", "hbox" , NULL, true },
- { "Ver Box", "vbox" , NULL, true },
- { "Table", "table" , NULL, true },
- { "Alignment", "align" , NULL, true },
- { "Tab Control", "tabcontrol" , NULL, true },
- { "Hor Splitter", "hsplitter" , NULL, true },
- { "Ver Splitter", "vsplitter" , NULL, true },
- { "Scroller", "scroller" , NULL, true },
-};
-const int WIDGETS_SPECS_LEN = sizeof (WIDGETS_SPECS) / sizeof (WidgetSpec);
-
-using namespace layout;
-using namespace layoutimpl;
-namespace css = ::com::sun::star;
-
-static rtl::OUString anyToString (uno::Any value)
-{
- try
- {
- switch (value.getValueTypeClass()) {
- case uno::TypeClass_STRING:
- return value.get<rtl::OUString>();
- case uno::TypeClass_CONSTANT:
- return rtl::OUString::valueOf (value.get<sal_Int32>());
- case uno::TypeClass_LONG:
- return rtl::OUString::valueOf (value.get<sal_Int64>());
- case uno::TypeClass_SHORT:
- // FIXME: seems broken
- return rtl::OUString::valueOf ((sal_Int32) value.get<short>());
-
- case uno::TypeClass_FLOAT:
- return rtl::OUString::valueOf (value.get<float>());
- case uno::TypeClass_DOUBLE:
- return rtl::OUString::valueOf (value.get<double>());
-
- case uno::TypeClass_BOOLEAN:
- {
- bool val = value.get<sal_Bool>();
- return rtl::OUString( val ? "1" : "0", 1, RTL_TEXTENCODING_ASCII_US );
-/* if ( val )
- return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "true" ) );
- else
- return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "false" ) );*/
- }
- default:
- break;
- }
- }
- catch(...) {}
- return rtl::OUString();
-}
-
-static inline long anyToNatural (uno::Any value)
-{ return sal::static_int_cast<long>(anyToString( value ).toInt64()); }
-static inline double anyToDecimal (uno::Any value)
-{ return anyToString( value ).toDouble(); }
-
-/* XLayoutContainer/XLayoutConstrains are a bit of a hasle to work with.
- Let's wrap them. */
-class Widget : public layoutimpl::LayoutWidget
-{
- friend class EditorRoot;
-
- Widget *mpParent;
- std::vector< Widget *> maChildren;
- bool mbForeign;
-
- rtl::OUString mrId;
- rtl::OUString mrLabel, mrUnoName;
-
-// TODO: store original properties. And some property handling methods.
- long mnOriAttrbs;
- layoutimpl::PropList maOriProps, maOriChildProps;
-
-public:
-
- // to be used to wrap the root
- Widget( uno::Reference< awt::XLayoutConstrains > xImport, const char *label )
- : mpParent( 0 ), mbForeign( true )
- {
- mxWidget = xImport;
- mxContainer = uno::Reference< awt::XLayoutContainer >( mxWidget, uno::UNO_QUERY );
-
- mrLabel = rtl::OUString( label, strlen( label ), RTL_TEXTENCODING_UTF8 );
- }
-
- Widget( rtl::OUString id, uno::Reference< awt::XToolkit > xToolkit,
- uno::Reference< awt::XLayoutContainer > xParent,
- rtl::OUString unoName, long nAttrbs )
- : mpParent( 0 ), mbForeign( false ), mrId( id ),
- mnOriAttrbs( nAttrbs )
- {
- while ( xParent.is() && !uno::Reference< awt::XWindow >( xParent, uno::UNO_QUERY ).is() )
- {
- uno::Reference< awt::XLayoutContainer > xContainer( xParent, uno::UNO_QUERY );
- OSL_ASSERT( xContainer.is() );
- xParent = uno::Reference< awt::XLayoutContainer >( xContainer->getParent(), uno::UNO_QUERY );
- }
-
- mxWidget = WidgetFactory::createWidget( xToolkit, xParent, unoName, nAttrbs );
- OSL_ASSERT( mxWidget.is() );
- mxContainer = uno::Reference< awt::XLayoutContainer >( mxWidget, uno::UNO_QUERY );
-
- mrLabel = mrUnoName = unoName;
- // try to get a nicer label for the widget
- for ( int i = 0; i < WIDGETS_SPECS_LEN; i++ )
- if ( unoName.equalsAscii( WIDGETS_SPECS[ i ].pName ) )
- {
- const char *label = WIDGETS_SPECS[ i ].pLabel;
- mrLabel = rtl::OUString( label, strlen( label ), RTL_TEXTENCODING_UTF8 );
- break;
- }
-
- // set default Text property
- // TODO: disable editing of text fields, check boxes selected, etc...
-
-
- // store original properties
- {
- PropertyIterator it( this, WINDOW_PROPERTY );
- while ( it.hasNext() )
- {
- beans::Property prop = it.next();
- rtl::OUString name( prop.Name );
- rtl::OUString value( getProperty( name, WINDOW_PROPERTY ) );
-#if DEBUG_PRINT
- fprintf(stderr, "original property: %s = %s\n", OUSTRING_CSTR(name), OUSTRING_CSTR(value));
-#endif
- std::pair< rtl::OUString, rtl::OUString > pair( name, value );
- maOriProps.push_back( pair );
- }
- }
-
- }
-
- ~Widget()
- {
- for ( std::vector< Widget *>::const_iterator it = maChildren.begin();
- it != maChildren.end(); ++it )
- delete *it;
- if ( !mbForeign )
- {
- uno::Reference< lang::XComponent > xComp( mxWidget, uno::UNO_QUERY );
- if ( xComp.is() )
- // some widgets, like our containers, don't implement this interface...
- xComp->dispose();
- }
- }
-
- uno::Reference< awt::XLayoutConstrains > impl()
- {
- return mxWidget;
- }
-
- // LayoutWidget
- virtual bool addChild( LayoutWidget *pChild )
- {
- return addChild( static_cast< Widget * >( pChild ) );
- }
-
- virtual void setProperties( const PropList &rProps )
- {
-// maOriProps = rProps;
- LayoutWidget::setProperties( rProps );
- }
-
- virtual void setChildProperties( LayoutWidget *pChild, const PropList &rProps )
- {
- maOriChildProps = rProps;
- LayoutWidget::setChildProperties( pChild, rProps );
- }
-
- // tree travel
- Widget *up()
- {
- return mpParent;
- }
-
- Widget *down()
- {
- if ( maChildren.empty() )
- return NULL;
- return maChildren.front();
- }
-
- Widget *next()
- {
- if ( mpParent )
- {
- int pos = mpParent->getChildPos( this );
- return mpParent->getChild( pos+1 );
- }
- return NULL;
- }
-
- Widget *prev()
- {
- if ( mpParent )
- {
- int pos = mpParent->getChildPos( this );
- return mpParent->getChild( pos-1 );
- }
- return NULL;
- }
-
- // handle
- bool addChild( Widget *pChild, int pos = 0xffff )
- {
- if ( !mxContainer.is() )
- return false;
-
- uno::Sequence< uno::Reference < awt::XLayoutConstrains > > aChildren;
- aChildren = mxContainer->getChildren();
- int nChildrenLen = aChildren.getLength();
-
- // ugly, but let's check if the container is next to full...
- try {
- mxContainer->addChild( pChild->mxWidget );
- }
- catch( awt::MaxChildrenException& rEx) {
- fprintf (stderr, "ERROR: MaxChildrenException: '%s'.\n",
- rtl::OUStringToOString (rEx.Message, RTL_TEXTENCODING_UTF8).getStr());
- return false;
- }
-
- if ( pos < nChildrenLen )
- { // if its on the middle, we need to make space for it
- mxContainer->removeChild( pChild->mxWidget );
- for ( int i = pos; i < nChildrenLen; i++ )
- mxContainer->removeChild( aChildren[ i ] );
- mxContainer->addChild( pChild->mxWidget );
- for ( int i = pos; i < nChildrenLen; i++ )
- mxContainer->addChild( aChildren[ i ] );
- maChildren.insert( maChildren.begin()+pos, pChild );
- }
- else
- maChildren.push_back( pChild );
-
- OSL_ASSERT( pChild->mpParent == NULL );
- pChild->mpParent = this;
-
- // store container props
- {
- pChild->maOriChildProps.clear();
- PropertyIterator it( pChild, CONTAINER_PROPERTY );
- while ( it.hasNext() )
- {
- beans::Property prop = it.next();
- rtl::OUString name( prop.Name );
- try {
- rtl::OUString value( pChild->getProperty( name, CONTAINER_PROPERTY ) );
- std::pair< rtl::OUString, rtl::OUString > pair( name, value );
- pChild->maOriChildProps.push_back( pair );
- } catch ( beans::UnknownPropertyException &rEx ) {
- fprintf (stderr, "ERROR: widget reports that it has a property it cannot return: '%s' this normally means that someone screwed up their PROPERTY_SET_INFO macro usage.\n",
- rtl::OUStringToOString (rEx.Message, RTL_TEXTENCODING_UTF8).getStr());
- return false;
- }
- }
- }
-
- return true;
- }
-
- bool removeChild( Widget *pChild )
- {
- if ( !mxContainer.is() || pChild->mpParent != this )
- return false;
-
- mxContainer->removeChild( pChild->mxWidget );
-
- unsigned int pos = getChildPos( pChild );
- if ( pos < maChildren.size() )
- maChildren.erase( maChildren.begin()+pos );
- pChild->mpParent = NULL;
-
- return true;
- }
-
- bool swapWithChild( Widget *pChild )
- {
- if ( !pChild->isContainer() )
- return false;
-
- // remove all child's childrens, and try to add them here
- removeChild( pChild );
-
- // keep a copy for failure
- std::vector< Widget *> aChildren = maChildren;
- std::vector< Widget *> aChildChildren = pChild->maChildren;
-
- for ( std::vector< Widget *>::const_iterator it = aChildChildren.begin();
- it != aChildChildren.end(); ++it )
- pChild->removeChild( *it );
-
- for ( std::vector< Widget *>::const_iterator it = aChildChildren.begin();
- it != aChildChildren.end(); ++it )
- if ( !addChild( *it ) )
- { // failure
- for ( std::vector< Widget *>::const_iterator jt = aChildChildren.begin();
- jt != it; ++jt )
- removeChild( *jt );
- for ( std::vector< Widget *>::const_iterator jt = aChildChildren.begin();
- jt != aChildChildren.end(); ++jt )
- pChild->addChild( *jt );
- return false;
- }
-
- Widget *pParent = up();
-
- if ( pParent )
- {
- pParent->removeChild( this );
- pParent->addChild( pChild );
- }
- pChild->addChild( this );
- return true;
- }
-
- unsigned int getChildPos( Widget *pChild )
- {
- int i = 0;
- for ( std::vector< Widget *>::const_iterator it = maChildren.begin();
- it != maChildren.end(); ++it, ++i )
- if ( *it == pChild )
- break;
- return i;
- }
-
- Widget *getChild( int pos )
- {
- if ( pos >= 0 && pos < (signed) maChildren.size() )
- return *(maChildren.begin() + pos);
- return NULL;
- }
-
- bool isContainer()
- { return mxContainer.is(); }
- unsigned int getChildrenLen()
- { return maChildren.size(); }
-
- rtl::OUString getLabel() const
- { return mrLabel; }
- rtl::OUString getUnoName() const
- { return mrUnoName; }
-
- int getDepth()
- {
- int depth = 0;
- for ( Widget *pWidget = mpParent; pWidget; pWidget = pWidget->mpParent )
- depth++;
- return depth;
- }
-
- enum PropertyKind {
- WINDOW_PROPERTY, CONTAINER_PROPERTY, WINBITS_PROPERTY
- };
-
- static rtl::OUString findProperty( const PropList &props, rtl::OUString propName )
- {
- for ( PropList::const_iterator it = props.begin(); it != props.end(); ++it )
- if ( it->first.equalsIgnoreAsciiCase( propName ) )
- return it->second;
-#if DEBUG_PRINT
- fprintf(stderr, "Serious error: property '%s' not found\n", OUSTRING_CSTR(propName));
-#endif
- return rtl::OUString();
- }
-
- rtl::OUString getOriginalProperty( rtl::OUString rPropName, PropertyKind rKind )
- {
- rtl::OUString rValue;
- switch ( rKind ) {
- case WINDOW_PROPERTY:
- rValue = findProperty( maOriProps, rPropName );
- break;
- case CONTAINER_PROPERTY:
- rValue = findProperty( maOriChildProps, rPropName );
- break;
- case WINBITS_PROPERTY:
- // TODO
- break;
- }
-
- return rValue;
- }
-
- rtl::OUString getProperty( rtl::OUString rPropName, PropertyKind rKind )
- {
- rtl::OUString rValue;
- switch ( rKind ) {
- case WINDOW_PROPERTY:
- rValue = anyToString( layoutimpl::prophlp::getProperty( mxWidget, rPropName ) );
- break;
- case CONTAINER_PROPERTY:
- if ( mpParent )
- rValue = anyToString( layoutimpl::prophlp::getProperty(
- mpParent->mxContainer->getChildProperties( mxWidget ), rPropName ) );
- break;
- case WINBITS_PROPERTY:
- // TODO
- break;
- }
-
- return rValue;
- }
-
- bool isPropertyTouched( rtl::OUString propName, PropertyKind rKind )
- {
- rtl::OUString oriValue = getOriginalProperty( propName, rKind );
- rtl::OUString newValue = getProperty( propName, rKind );
- bool isTouched = oriValue != newValue;
-#if DEBUG_PRINT
- fprintf(stderr, "is property '%s' touched? %s (%s vs %s)\n", OUSTRING_CSTR(propName), isTouched ? "yes" : "no", OUSTRING_CSTR(oriValue), OUSTRING_CSTR(newValue));
-#endif
- return isTouched;
- }
-
- using LayoutWidget::setProperty;
-
- void setProperty( rtl::OUString rPropName, PropertyKind rKind, uno::Any rValue )
- {
- switch ( rKind ) {
- case WINDOW_PROPERTY:
- layoutimpl::prophlp::setProperty( mxWidget, rPropName, rValue );
- break;
- case CONTAINER_PROPERTY:
- if ( mpParent )
- layoutimpl::prophlp::setProperty(
- mpParent->mxContainer->getChildProperties( mxWidget ), rPropName, rValue );
- break;
- case WINBITS_PROPERTY:
- // TODO
- break;
- }
- }
-
- struct PropertyIterator {
- friend class Widget;
- PropertyKind mrKind;
- uno::Sequence< beans::Property > maProps;
- int nPropIt;
-
- PropertyIterator( Widget *pWidget, PropertyKind rKind )
- : mrKind( rKind ), nPropIt( 0 )
- {
- switch ( rKind )
- {
- case WINDOW_PROPERTY:
- if ( layoutimpl::prophlp::canHandleProps( pWidget->mxWidget ) )
- {
- uno::Reference< beans::XPropertySetInfo > xInfo
- = layoutimpl::prophlp::queryPropertyInfo( pWidget->mxWidget );
- if ( !xInfo.is() )
- return;
-
- maProps = xInfo->getProperties();
- }
- break;
- case CONTAINER_PROPERTY:
- if ( pWidget->mpParent )
- {
- uno::Reference< beans::XPropertySet >xParentSet(
- pWidget->mpParent->mxContainer->getChildProperties( pWidget->mxWidget ) );
- if ( xParentSet.is())
- {
- uno::Reference< beans::XPropertySetInfo > xInfo( xParentSet->getPropertySetInfo() );
- if ( xInfo.is() )
- maProps = xInfo->getProperties();
- }
- }
- break;
- case WINBITS_PROPERTY:
- // TODO
- break;
- }
- }
-
- bool hasNext()
- {
- return nPropIt < maProps.getLength();
- }
-
- beans::Property next()
- {
-/* rtl::OUString propName, propValue;
- propName = maProps[ nPropIt ];
- propValue = getProperty( propName, mrKind, false);
- nPropIt++;
- return std::pair< rtl::OUString, rtl::OUString > propPair( propName, propValue );*/
- return maProps[ nPropIt++ ];
- }
- };
-};
-
-class EditorRoot : public layoutimpl::LayoutRoot {
- Widget *mpParent;
-
-public:
- EditorRoot( const uno::Reference< lang::XMultiServiceFactory >& xFactory,
- Widget *pParent )
- : layoutimpl::LayoutRoot( xFactory ), mpParent( pParent )
- {
- }
-
- // generation
- virtual layoutimpl::LayoutWidget *create( rtl::OUString id, const rtl::OUString unoName,
- long attrbs, uno::Reference< awt::XLayoutContainer > xParent )
- {
- if ( unoName.compareToAscii( "dialog" ) == 0 )
- return mpParent;
-
- // TODO: go through specs to map unoName to a more human-readable label
- Widget *pWidget = new Widget( id, mxToolkit, xParent, unoName, attrbs );
- if ( !mxWindow.is() )
- mxWindow = uno::Reference< awt::XWindow >( pWidget->getPeer(), uno::UNO_QUERY );
-
- if ( pWidget->mxContainer.is() )
- pWidget->mxContainer->setLayoutUnit( mpParent->mxContainer->getLayoutUnit() );
-
- return pWidget;
- }
-};
-
-/* Working with the layout in 1D, as if it was a flat list. */
-namespace FlatLayout
-{
-Widget *next( Widget *pWidget )
-{
- Widget *pNext;
- pNext = pWidget->down();
- if ( pNext ) return pNext;
- pNext = pWidget->next();
- if ( pNext ) return pNext;
- for ( Widget *pUp = pWidget->up(); pUp != NULL; pUp = pUp->up() )
- if ( (pNext = pUp->next()) != NULL )
- return pNext;
- return NULL;
-}
-
-/*
- Widget *prev( Widget *pWidget )
- {
- Widget *pPrev;
- pPrev = pWidget->prev();
- if ( !pPrev )
- return pWidget->up();
-
- Widget *pBottom = pPrev->down();
- if ( pBottom )
- {
- while ( pBottom->down() || pBottom->next() )
- {
- for ( Widget *pNext = pBottom->next(); pNext; pNext = pNext->next() )
- pBottom = pNext;
- Widget *pDown = pBottom->down();
- if ( pDown )
- pBottom = pDown;
- }
- return pBottom;
- }
- return pPrev;
- }
-*/
-
-bool moveWidget( Widget *pWidget, bool up /*or down*/ )
-{
- // Keep child parent&pos for in case of failure
- Widget *pOriContainer = pWidget->up();
- unsigned int oriChildPos = pOriContainer->getChildPos( pWidget );
-
- // Get parent&sibling before removing it, since relations get cut
- Widget *pSibling = up ? pWidget->prev() : pWidget->next();
- Widget *pContainer = pWidget->up();
- if ( !pContainer )
- return false;
-
- // try to swap with parent or child
- // We need to allow for this at least for the root node...
- if ( !pSibling )
- {
- if ( up )
- {
- if ( pContainer->swapWithChild( pWidget ) )
- return true;
- }
- else
- {
- }
- }
-
- pContainer->removeChild( pWidget );
-
- // if has up sibling -- append to it, else swap with it
- if ( pSibling )
- {
- if ( pSibling->addChild( pWidget, up ? 0xffff : 0 ) )
- return true;
-
- unsigned int childPos = pContainer->getChildPos( pSibling );
- if ( pContainer->addChild( pWidget, childPos + (up ? 0 : 1) ) )
- return true; // should always be succesful
- }
- // go through parents -- try to get prepended to them
- else
- {
- for ( ; pContainer && pContainer->up(); pContainer = pContainer->up() )
- {
- unsigned int childPos = pContainer->up()->getChildPos( pContainer );
- if ( pContainer->up()->addChild( pWidget, childPos + (up ? 0 : 1) ) )
- return true;
- }
- }
-
- // failed -- try to get it to its old position
- if ( !pOriContainer->addChild( pWidget, oriChildPos ) )
- {
- // a parent should never reject a child back. but if it ever
- // happens, just kill it, we don't run an orphanate here ;P
- delete pWidget;
- return true;
- }
- return false;
-}
-
-// NOTE: root is considered to be number -1
-Widget *get( Widget *pRoot, int nb )
-{
- Widget *it;
- for ( it = pRoot; it != NULL && nb >= 0; it = next( it ) )
- nb--;
- return it;
-}
-
-int get( Widget *pRoot, Widget *pWidget )
-{
- int nRet = -1;
- Widget *it;
- for ( it = pRoot; it != NULL && it != pWidget; it = next( it ) )
- nRet++;
- return nRet;
-}
-}
-
-//** PropertiesList widget
-
-class PropertiesList : public layout::Table
-{
- class PropertyEntry
- {
- friend class PropertiesList;
-
- /* wrapper between the widget and Any */
- struct AnyWidget
- {
- DECL_LINK( ApplyPropertyHdl, layout::Window* );
- DECL_LINK( FlagToggledHdl, layout::CheckBox* );
-
- AnyWidget( Widget *pWidget, rtl::OUString aPropName, Widget::PropertyKind aPropKind )
- : mpWidget( pWidget ), maPropName( aPropName ), maPropKind( aPropKind )
- {
- mpFlag = 0;
- mbBlockFlagCallback = false;
- bFirstGet = true;
- }
-
- virtual ~AnyWidget()
- {
-#if DEBUG_PRINT
- fprintf(stderr, "~AnyWidget\n");
-#endif
- }
-
- void save( uno::Any aValue )
- {
- mpWidget->setProperty( maPropName, maPropKind, aValue );
- checkProperty();
- }
-
- void checkProperty()
- {
- bool flag = mpWidget->isPropertyTouched( maPropName, maPropKind );
-
- if ( mpFlag && mpFlag->IsChecked() != (BOOL)flag )
- {
- CheckFlag( flag, true );
- }
- }
-
- void CheckFlag( bool bValue, bool bBlockCallback )
- {
- if ( bBlockCallback )
- mbBlockFlagCallback = true;
- mpFlag->Check( bValue );
- mbBlockFlagCallback = false;
- }
-
- bool bFirstGet; // HACK
- rtl::OUString getValue()
- {
-// return mpWidget->getOriProperty( maPropName );
- rtl::OUString value;
- if ( bFirstGet ) // king of ugliness
- value = mpWidget->getProperty( maPropName, maPropKind );
- else
- value = mpWidget->getOriginalProperty( maPropName, maPropKind );
- bFirstGet = false;
- return value;
- }
-
- // FIXME: wrapper should have a base class for this...
- virtual layout::Window *getWindow() = 0;
- virtual layout::Container *getContainer() { return NULL; }
-
- virtual void load() = 0;
- virtual void store() = 0;
-
- Widget *mpWidget;
- rtl::OUString maPropName;
- Widget::PropertyKind maPropKind;
- layout::CheckBox *mpFlag;
- bool mbBlockFlagCallback;
- };
-
- struct AnyEdit : public AnyWidget, layout::HBox
- {
- layout::Edit *mpEdit;
- bool mbMultiLine;
- layout::PushButton *mpExpand;
- DECL_LINK( ExpandEditHdl, layout::PushButton* );
-
- // so we can create widgets (like transforming the Edit into a
- // MultiLineEdit)
- layout::Window *mpWinParent;
-
- AnyEdit( Widget *pWidget, rtl::OUString aPropName,
- Widget::PropertyKind aPropKind, layout::Window *pWinParent )
- : AnyWidget( pWidget, aPropName, aPropKind ), layout::HBox( 0, false ), mpWinParent( pWinParent )
- {
- mpEdit = NULL;
- mpExpand = new layout::PushButton( pWinParent, WB_TOGGLE );
- mpExpand->SetToggleHdl( LINK( this, AnyEdit, ExpandEditHdl ) );
- setAsMultiLine( false );
-
- load();
- }
-
- virtual ~AnyEdit()
- {
- delete mpEdit;
- delete mpExpand;
- }
-
- virtual layout::Window *getWindow()
- { return NULL; }
- virtual layout::Container *getContainer()
- { return this; }
-
- void setAsMultiLine( bool bMultiLine )
- {
- Clear();
- XubString text;
- if ( mpEdit )
- {
- text = mpEdit->GetText();
- printf("Remove mpEdit and expand\n");
- Remove( mpEdit );
- Remove( mpExpand );
- delete mpEdit;
- }
-
- if ( bMultiLine )
- {
- mpEdit = new layout::Edit( mpWinParent, WB_BORDER );
- mpExpand->SetText( String::CreateFromAscii( "-" ) );
- }
- else
- {
- mpEdit = new layout::Edit( mpWinParent, WB_BORDER );
- mpExpand->SetText( String::CreateFromAscii( "+" ) );
- }
-
- mpEdit->SetText( text );
- mpEdit->SetModifyHdl( LINK( this, AnyEdit, ApplyPropertyHdl ) );
-
- Add( mpEdit, true, true, 0 );
- Add( mpExpand, false, true, 0 );
-
- mbMultiLine = bMultiLine;
- }
-
- virtual void load()
- {
- mpEdit->SetText( getValue() );
- checkProperty();
- }
-
- virtual void store()
- {
- save( uno::makeAny( (rtl::OUString) mpEdit->GetText() ) );
- }
- };
-
- struct AnyInteger : public AnyWidget, NumericField
- {
- AnyInteger( Widget *pWidget, rtl::OUString aPropName,
- Widget::PropertyKind aPropKind, Window *pWinParent )
- : AnyWidget( pWidget, aPropName, aPropKind ), NumericField( pWinParent, WB_SPIN|WB_BORDER )
- {
- load();
- SetModifyHdl( LINK( this, AnyInteger, ApplyPropertyHdl ) );
- }
-
- virtual Window *getWindow()
- { return this; }
-
- virtual void load()
- {
- OUString text = getValue();
- SetText( text.getStr() );
- checkProperty();
- }
-
- virtual void store()
- {
-#if DEBUG_PRINT
- fprintf(stderr, "store number: %ld\n", rtl::OUString( GetText() ).toInt64());
-#endif
- save( uno::makeAny( rtl::OUString( GetText() ).toInt64() ) );
- }
- };
-
- struct AnyFloat : public AnyInteger
- {
- AnyFloat( Widget *pWidget, rtl::OUString aPropName,
- Widget::PropertyKind aPropKind, Window *pWinParent )
- : AnyInteger( pWidget, aPropName, aPropKind, pWinParent )
- {}
-
- virtual void store()
- {
- save( uno::makeAny( rtl::OUString( GetText() ).toDouble() ) );
- }
- };
-
- struct AnyCheckBox : public AnyWidget, layout::CheckBox
- {
- AnyCheckBox( Widget *pWidget, rtl::OUString aPropName,
- Widget::PropertyKind aPropKind, layout::Window *pWinParent )
- : AnyWidget( pWidget, aPropName, aPropKind ), layout::CheckBox( pWinParent )
- {
- // adding some whitespaces to make the hit area larger
-// SetText( String::CreateFromAscii( "" ) );
- load();
- SetToggleHdl( LINK( this, AnyWidget, ApplyPropertyHdl ) );
- }
-
- virtual ~AnyCheckBox()
- {
-#if DEBUG_PRINT
- fprintf(stderr, "~AnyCheckBox\n");
-#endif
- }
-
- virtual layout::Window *getWindow()
- { return this; }
-
- virtual void load()
- {
-#if DEBUG_PRINT
- fprintf(stderr, "loading boolean value\n");
-#endif
- Check( getValue().toInt64() != 0 );
- setLabel();
- checkProperty();
- }
-
- virtual void store()
- {
- save( uno::makeAny( IsChecked() ) );
- setLabel();
- }
-
- void setLabel()
- {
- SetText( String::CreateFromAscii( IsChecked() ? "true" : "false" ) );
- }
- };
-
- struct AnyListBox : public AnyWidget, layout::ListBox
- {
- AnyListBox( Widget *pWidget, rtl::OUString aPropName,
- Widget::PropertyKind aPropKind, Window *pWinParent )
- : AnyWidget( pWidget, aPropName, aPropKind ), layout::ListBox( pWinParent, WB_DROPDOWN )
- {
- SetSelectHdl( LINK( this, AnyWidget, ApplyPropertyHdl ) );
- }
-
- virtual layout::Window *getWindow()
- { return this; }
-
- virtual void load()
- {
- SelectEntryPos( sal::static_int_cast< USHORT >( getValue().toInt32() ) );
- checkProperty();
- }
-
- virtual void store()
- {
- save( uno::makeAny( (short) GetSelectEntryPos() ) );
- }
- };
-
- struct AnyAlign : public AnyListBox
- {
- AnyAlign( Widget *pWidget, rtl::OUString aPropName,
- Widget::PropertyKind aPropKind, Window *pWinParent )
- : AnyListBox( pWidget, aPropName, aPropKind, pWinParent )
- {
- InsertEntry( XubString::CreateFromAscii( "Left" ) );
- InsertEntry( XubString::CreateFromAscii( "Center" ) );
- InsertEntry( XubString::CreateFromAscii( "Right" ) );
- load();
- }
- };
-
- /* AnyListBox and AnyComboBox different in that a ComboBox allows the user
- to add other options, operating in strings, instead of constants.
- (its more like a suggestive AnyEdit) */
- struct AnyComboBox : public AnyWidget, layout::ComboBox
- {
- AnyComboBox( Widget *pWidget, rtl::OUString aPropName,
- Widget::PropertyKind aPropKind, Window *pWinParent )
- : AnyWidget( pWidget, aPropName, aPropKind ), layout::ComboBox( pWinParent, WB_DROPDOWN )
- {
- SetModifyHdl( LINK( this, AnyComboBox, ApplyPropertyHdl ) );
- }
-
- virtual layout::Window *getWindow()
- { return this; }
-
- virtual void load()
- {
- SetText( getValue() );
- checkProperty();
- }
-
- virtual void store()
- {
- save( uno::makeAny( (rtl::OUString) GetText() ) );
- }
- };
-
- struct AnyFontStyle : public AnyComboBox
- {
- AnyFontStyle( Widget *pWidget, rtl::OUString aPropName,
- Widget::PropertyKind aPropKind, Window *pWinParent )
- : AnyComboBox( pWidget, aPropName, aPropKind, pWinParent )
- {
- InsertEntry( XubString::CreateFromAscii( "Bold" ) );
- InsertEntry( XubString::CreateFromAscii( "Italic" ) );
- InsertEntry( XubString::CreateFromAscii( "Bold Italic" ) );
- InsertEntry( XubString::CreateFromAscii( "Fett" ) );
- load();
- }
- };
-
- layout::FixedText *mpLabel;
- layout::CheckBox *mpFlag;
- AnyWidget *mpValue;
-
- public:
- PropertyEntry( layout::Window *pWinParent, AnyWidget *pAnyWidget )
- {
- mpLabel = new layout::FixedText( pWinParent );
- {
- // append ':' to aPropName
- rtl::OUStringBuffer buf( pAnyWidget->maPropName );
- buf.append( sal_Unicode (':') );
- mpLabel->SetText( buf.makeStringAndClear() );
- }
- mpValue = pAnyWidget;
- mpFlag = new layout::CheckBox( pWinParent );
- mpFlag->SetToggleHdl( LINK( mpValue, AnyWidget, FlagToggledHdl ) );
- mpValue->mpFlag = mpFlag;
- }
-
- ~PropertyEntry()
- {
-#if DEBUG_PRINT
- fprintf(stderr, "REMOVING label, flag and value\n");
-#endif
- delete mpLabel;
- delete mpFlag;
- delete mpValue;
- }
-
- // Use this factory rather than the constructor -- check for NULL
- static PropertyEntry *construct( Widget *pWidget, rtl::OUString aPropName,
- Widget::PropertyKind aPropKind, sal_uInt16 nType,
- layout::Window *pWinParent )
- {
- AnyWidget *pAnyWidget;
- switch (nType) {
- case uno::TypeClass_STRING:
- if ( aPropName.compareToAscii( "FontStyleName" ) == 0 )
- {
- pAnyWidget = new AnyFontStyle( pWidget, aPropName, aPropKind, pWinParent );
- break;
- }
- pAnyWidget = new AnyEdit( pWidget, aPropName, aPropKind, pWinParent );
- break;
- case uno::TypeClass_SHORT:
- if ( aPropName.compareToAscii( "Align" ) == 0 )
- {
- pAnyWidget = new AnyAlign( pWidget, aPropName, aPropKind, pWinParent );
- break;
- }
- // otherwise, treat as any other number...
- case uno::TypeClass_LONG:
- case uno::TypeClass_UNSIGNED_LONG:
- pAnyWidget = new AnyInteger( pWidget, aPropName, aPropKind, pWinParent );
- break;
- case uno::TypeClass_FLOAT:
- case uno::TypeClass_DOUBLE:
- pAnyWidget = new AnyFloat( pWidget, aPropName, aPropKind, pWinParent );
- break;
- case uno::TypeClass_BOOLEAN:
- pAnyWidget = new AnyCheckBox( pWidget, aPropName, aPropKind, pWinParent );
- break;
- default:
- return NULL;
- }
- return new PropertyEntry( pWinParent, pAnyWidget );
- }
- };
-
- layout::Window *mpParentWindow;
-
- std::list< PropertyEntry* > maPropertiesList;
- layout::FixedLine *mpSeparator;
-
- // some properties are obscure, or simply don't make sense in this
- // context. Let's just ignore them.
- // Maybe we could offer them in an expander or something...
- static bool toIgnore( rtl::OUString prop )
- {
- // binary search -- keep the list sorted alphabetically
- static char const *toIgnoreList[] = {
- "DefaultControl", "FocusOnClick", "FontCharWidth", "FontCharset",
- "FontEmphasisMark", "FontFamily", "FontHeight", "FontKerning", "FontName",
- "FontOrientation", "FontPitch", "FontRelief", "FontSlant", "FontStrikeout",
- "FontType", "FontWordLineMode", "HelpText", "HelpURL", "MultiLine",
- "Printable", "Repeat", "RepeatDelay", "Tabstop"
- };
-
- int min = 0, max = sizeof( toIgnoreList )/sizeof( char * ) - 1, mid, cmp;
- do {
- mid = min + (max - min)/2;
- cmp = prop.compareToAscii( toIgnoreList[ mid ] );
- if ( cmp > 0 )
- min = mid+1;
- else if ( cmp < 0 )
- max = mid-1;
- else
- return true;
- } while ( min <= max );
- return false;
- }
-
-public:
- PropertiesList( layout::Dialog *dialog )
- : layout::Table( dialog, "properties-box" )
- , mpParentWindow( dialog ), mpSeparator( 0 )
- {
- }
-
- ~PropertiesList()
- {
- clear();
- }
-
-private:
- // auxiliary, add properties from the peer to the list
- void addProperties( Widget *pWidget, Widget::PropertyKind rKind )
- {
- Widget::PropertyIterator it( pWidget, rKind );
- while ( it.hasNext() )
- {
- beans::Property prop = it.next();
- rtl::OUString name( prop.Name );
- if ( toIgnore( name ) )
- continue;
- sal_uInt16 type = static_cast< sal_uInt16 >( prop.Type.getTypeClass() );
-
- PropertyEntry *propEntry = PropertyEntry::construct(
- pWidget, name, rKind, type, mpParentWindow );
-
- if ( propEntry )
- {
- Add( propEntry->mpLabel, false, false );
-
- // HACK: one of these will return Null...
- Add( propEntry->mpValue->getWindow(), true, false );
- Add( propEntry->mpValue->getContainer(), true, false );
-
- Add( propEntry->mpFlag, false, false );
- maPropertiesList.push_back( propEntry );
- }
- }
- }
-
-public:
- void selectedWidget( Widget *pWidget )
- {
- clear();
-
- if ( !pWidget )
- return;
-
- addProperties( pWidget, Widget::CONTAINER_PROPERTY );
-
- mpSeparator = new layout::FixedLine( mpParentWindow );
- // TODO: we may want to have to separate list widgets here...
- Add( mpSeparator, false, false, 3, 1 );
-
- addProperties( pWidget, Widget::WINDOW_PROPERTY );
-
- ShowAll( true );
- }
-
- void clear()
- {
- ///FIXME: crash
- Container::Clear();
-
- for ( std::list< PropertyEntry* >::iterator it = maPropertiesList.begin();
- it != maPropertiesList.end(); ++it)
- delete *it;
- maPropertiesList.clear();
-
- delete mpSeparator;
- mpSeparator = NULL;
- }
-};
-
-IMPL_LINK( PropertiesList::PropertyEntry::AnyWidget, ApplyPropertyHdl, layout::Window *, pWin )
-{
- (void) pWin;
- store();
- return 0;
-}
-
-IMPL_LINK( PropertiesList::PropertyEntry::AnyWidget, FlagToggledHdl, layout::CheckBox *, pCheck )
-{
-#if DEBUG_PRINT
- fprintf(stderr, "Property flag pressed -- is: %d\n", pCheck->IsChecked());
-#endif
- if ( !mbBlockFlagCallback )
- {
- bool checked = pCheck->IsChecked();
- if ( !checked ) // revert
- {
-#if DEBUG_PRINT
- fprintf(stderr, "revert\n");
-#endif
- load();
- }
- else
- {
-#if DEBUG_PRINT
- fprintf(stderr, "user can't dirty the flag!\n");
-#endif
- // User can't flag the property as dirty
- // Actually, we may want to allow the designer to force a property to be stored.
- // Could be useful when the default value of some new property wasn't yet decided...
- CheckFlag( false, true );
- }
- }
-#if DEBUG_PRINT
- else
- fprintf(stderr, "Property flag pressed -- BLOCKED\n");
-#endif
- return 0;
-}
-
-IMPL_LINK( PropertiesList::PropertyEntry::AnyEdit, ExpandEditHdl, layout::PushButton *, pBtn )
-{
- setAsMultiLine( pBtn->IsChecked() );
- return 0;
-}
-
-//** SortListBox auxiliary widget
-
-class SortListBox
-{ // For a manual sort ListBox; asks for a ListBox and Up/Down/Remove
- // buttons to wrap
- DECL_LINK( ItemSelectedHdl, layout::ListBox* );
- DECL_LINK( UpPressedHdl, layout::Button* );
- DECL_LINK( DownPressedHdl, layout::Button* );
- DECL_LINK( RemovePressedHdl, layout::Button* );
- layout::PushButton *mpUpButton, *mpDownButton, *mpRemoveButton;
-
-protected:
- layout::ListBox *mpListBox;
-
- virtual void upPressed( USHORT nPos )
- {
- XubString str = mpListBox->GetSelectEntry();
- mpListBox->RemoveEntry( nPos );
- nPos = mpListBox->InsertEntry( str, nPos-1 );
- mpListBox->SelectEntryPos( nPos );
- }
-
- virtual void downPressed( USHORT nPos )
- {
- XubString str = mpListBox->GetSelectEntry();
- mpListBox->RemoveEntry( nPos );
- nPos = mpListBox->InsertEntry( str, nPos+1 );
- mpListBox->SelectEntryPos( nPos );
- }
-
- virtual void removePressed( USHORT nPos )
- {
- mpListBox->RemoveEntry( nPos );
- }
-
- virtual void itemSelected( USHORT nPos )
- {
- // if we had some XLayoutContainer::canAdd() or maxChildren() function
- // we could make a function to check if we can move selected and enable/
- // /disable the move buttons as appropriate
-
- if ( nPos == LISTBOX_ENTRY_NOTFOUND )
- {
- mpUpButton->Disable();
- mpDownButton->Disable();
- mpRemoveButton->Disable();
- }
- else
- {
- mpUpButton->Enable();
- mpDownButton->Enable();
- mpRemoveButton->Enable();
- }
- }
-
-public:
- SortListBox( layout::ListBox *pListBox, layout::PushButton *pUpButton, layout::PushButton *pDownButton,
- layout::PushButton *pRemoveButton )
- : mpUpButton( pUpButton), mpDownButton( pDownButton), mpRemoveButton( pRemoveButton ),
- mpListBox( pListBox )
- {
- mpListBox->SetSelectHdl( LINK( this, SortListBox, ItemSelectedHdl ) );
-
- mpUpButton->SetModeImage( layout::Image ( "cmd/lc_moveup.png" ) );
- mpUpButton->SetImageAlign( IMAGEALIGN_LEFT );
- mpUpButton->SetClickHdl( LINK( this, SortListBox, UpPressedHdl ) );
-
- mpDownButton->SetModeImage( layout::Image ( "cmd/lc_movedown.png" ) );
- mpDownButton->SetImageAlign( IMAGEALIGN_LEFT );
- mpDownButton->SetClickHdl( LINK( this, SortListBox, DownPressedHdl ) );
-
- // "cmd/lch_delete.png", "cmd/lc_delete.png"
- mpRemoveButton->SetModeImage( layout::Image ( "cmd/sc_closedoc.png" ) );
- mpRemoveButton->SetImageAlign( IMAGEALIGN_LEFT );
- mpRemoveButton->SetClickHdl( LINK( this, SortListBox, RemovePressedHdl ) );
-
- // fire an un-select event
- itemSelected( LISTBOX_ENTRY_NOTFOUND );
- }
-
- virtual ~SortListBox();
-};
-
-SortListBox::~SortListBox()
-{
- delete mpListBox;
- delete mpUpButton;
- delete mpDownButton;
- delete mpRemoveButton;
-}
-
-IMPL_LINK( SortListBox, UpPressedHdl, layout::Button *, pBtn )
-{
- (void) pBtn;
- USHORT pos = mpListBox->GetSelectEntryPos();
- if ( pos > 0 && pos != LISTBOX_ENTRY_NOTFOUND )
- upPressed( pos );
- return 0;
-}
-
-IMPL_LINK( SortListBox, DownPressedHdl, layout::Button *, pBtn )
-{
- (void) pBtn;
- USHORT pos = mpListBox->GetSelectEntryPos();
- if ( pos < mpListBox->GetEntryCount() && pos != LISTBOX_ENTRY_NOTFOUND )
- downPressed( pos );
- return 0;
-}
-
-IMPL_LINK( SortListBox, RemovePressedHdl, layout::Button *, pBtn )
-{
- (void) pBtn;
- USHORT pos = mpListBox->GetSelectEntryPos();
- if ( pos != LISTBOX_ENTRY_NOTFOUND )
- removePressed( pos );
- return 0;
-}
-
-IMPL_LINK( SortListBox, ItemSelectedHdl, layout::ListBox *, pList )
-{
- (void) pList;
- USHORT pos = mpListBox->GetSelectEntryPos();
- itemSelected( pos );
- return 0;
-}
-
-//** LayoutTree widget
-
-class LayoutTree : public SortListBox
-{
-public:
- struct Listener
- {
- virtual void widgetSelected( Widget *pWidget ) = 0;
- };
-
-private:
- Listener *mpListener;
-
-public:
- Widget *mpRootWidget;
-
- LayoutTree( layout::Dialog *dialog )
- : SortListBox( new layout::ListBox( dialog, "layout-tree" ),
- new layout::PushButton( dialog, "layout-up-button" ),
- new layout::PushButton( dialog, "layout-down-button" ),
- new layout::PushButton( dialog, "layout-remove-button" ) )
- {
- layout::PeerHandle handle = dialog->GetPeerHandle( "preview-box" );
- uno::Reference< awt::XLayoutConstrains > xWidget( handle, uno::UNO_QUERY );
- mpRootWidget = new Widget( xWidget, "root" );
- }
-
- virtual ~LayoutTree();
-
- Widget *getWidget( int nPos )
- {
- if ( nPos != LISTBOX_ENTRY_NOTFOUND )
- return FlatLayout::get( mpRootWidget, nPos );
- return NULL;
- }
-
- Widget *getSelectedWidget()
- {
- Widget *pWidget = getWidget( mpListBox->GetSelectEntryPos() );
- if ( !pWidget ) // return root, if none selected
- pWidget = mpRootWidget;
- return pWidget;
- }
-
- void selectWidget( Widget *pWidget )
- {
- int pos = FlatLayout::get( mpRootWidget, pWidget );
- if ( pos == -1 )
- // if asked to select hidden root, select visible root
- pos = 0;
- mpListBox->SelectEntryPos( sal::static_int_cast< USHORT >( pos ) );
- }
-
- void rebuild()
- {
- struct inner
- {
- // pads a string with whitespaces
- static rtl::OUString padString( rtl::OUString name, int depth )
- {
- rtl::OStringBuffer aBuf( depth * 4 + name.getLength() + 2 );
- for (int i = 0; i < depth; i++)
- aBuf.append( " " );
- aBuf.append( rtl::OUStringToOString( name, RTL_TEXTENCODING_ASCII_US ) );
- return rtl::OUString( aBuf.getStr(), aBuf.getLength(),
- RTL_TEXTENCODING_UTF8 );
- }
- };
-
- mpListBox->Clear();
- for ( Widget *i = FlatLayout::next( mpRootWidget ); i; i = FlatLayout::next( i ) )
- mpListBox->InsertEntry( inner::padString( i->getLabel(), i->getDepth()-1 ) );
-
- // any selection, no longer is. ListBox doesn't fire the event on this case;
- // force it.
- itemSelected( LISTBOX_ENTRY_NOTFOUND );
- }
-
- void setListener( Listener *pListener )
- { mpListener = pListener; }
-
- // print in XML format...
-
- static rtl::OUString toXMLNaming (const rtl::OUString &string)
- {
- rtl::OUStringBuffer buffer (string.getLength());
- sal_Unicode *str = string.pData->buffer;
- for (int i = 0; i < string.getLength(); i++) {
- if ( str[i] >= 'A' && str[i] <= 'Z' )
- {
- if ( i > 0 )
- buffer.append ((sal_Unicode) '-');
- buffer.append ((sal_Unicode) (str[i] - 'A' + 'a'));
- }
- else
- buffer.append ((sal_Unicode) str[i]);
- }
-
- return buffer.makeStringAndClear();
- }
-
- void print()
- {
- printf("\t\tExport:\n");
- printf("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
- "<dialog xmlns=\"http://openoffice.org/2007/layout\"\n"
- " xmlns:cnt=\"http://openoffice.org/2007/layout/container\"\n"
- " id=\"dialog\" title=\"Unnamed\" sizeable=\"true\" >\n");
-
- for ( Widget *i = FlatLayout::next( mpRootWidget ); i; i = FlatLayout::next( i ) )
- {
- for ( int d = i->getDepth(); d > 0; d-- )
- printf(" ");
- printf("<%s ", OUSTRING_CSTR( i->getUnoName() ) );
-
- for ( int kind = 0; kind < 2; kind++ )
- {
- Widget::PropertyKind wKind = kind == 0 ? Widget::WINDOW_PROPERTY
- : Widget::CONTAINER_PROPERTY;
- Widget::PropertyIterator it( i, wKind );
- while ( it.hasNext() )
- {
- beans::Property prop = it.next();
- if ( !i->isPropertyTouched( prop.Name, wKind ) )
- continue;
-
- rtl::OUString value = i->getProperty( prop.Name, wKind );
- if ( prop.Type.getTypeClass() == uno::TypeClass_BOOLEAN )
- {
- if ( value.compareToAscii( "0" ) )
- value = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("false") );
- else
- value = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("true") );
- }
-
- if ( value.getLength() > 0 )
- printf("%s%s=\"%s\" ",
- kind == 0 ? "" : "cnt:",
- OUSTRING_CSTR( toXMLNaming( prop.Name ) ), OUSTRING_CSTR( value )
- );
-
- }
- }
- printf("/>\n");
- }
- printf("</dialog>\n");
- }
-
-protected:
- virtual void upPressed( USHORT nPos )
- {
- Widget *pWidget = getWidget( nPos );
- if ( FlatLayout::moveWidget( pWidget, true ) )
- rebuild();
- selectWidget( pWidget );
- }
-
- virtual void downPressed( USHORT nPos )
- {
- Widget *pWidget = getWidget( nPos );
- if ( FlatLayout::moveWidget( pWidget, false ) )
- rebuild();
- selectWidget( pWidget );
- }
-
- virtual void removePressed( USHORT nPos )
- {
- Widget *pWidget = getWidget( nPos );
- if ( pWidget )
- {
- pWidget->up()->removeChild( pWidget );
- delete pWidget;
- rebuild();
- }
- }
-
- virtual void itemSelected( USHORT nPos )
- {
- mpListener->widgetSelected( getWidget( nPos ) );
- SortListBox::itemSelected( nPos );
- }
-};
-
-LayoutTree::~LayoutTree()
-{
- delete mpRootWidget;
-}
-
-//** EditorImpl
-
-class EditorImpl : public LayoutTree::Listener
-{
- void createWidget( const char *unoName );
-
- PropertiesList *mpPropertiesList;
- LayoutTree *mpLayoutTree;
-
- layout::PushButton *pImportButton, *pExportButton;
-#ifdef FILEDLG
- FileDialog *pImportDialog;
-#endif
- DECL_LINK( ImportButtonHdl, layout::PushButton* );
- DECL_LINK( ExportButtonHdl, layout::PushButton* );
-#ifdef FILEDLG
- DECL_LINK( ImportDialogHdl, FileDialog* );
-#endif
-
- // framework stuff
- uno::Reference< lang::XMultiServiceFactory > mxFactory;
- uno::Reference< awt::XToolkit > mxToolkit;
- uno::Reference< awt::XWindow > mxToplevel;
-
- virtual void widgetSelected( Widget *pWidget );
- DECL_LINK( CreateWidgetHdl, layout::Button* );
-
- std::list< layout::PushButton *> maCreateButtons;
-
-public:
-
- EditorImpl( layout::Dialog *dialog,
- // we should probable open this channel (or whatever its called) ourselves
- uno::Reference< lang::XMultiServiceFactory > xMSF );
- virtual ~EditorImpl();
-
- void loadFile( const rtl::OUString &aTestFile );
-};
-
-EditorImpl::EditorImpl( layout::Dialog *dialog,
- uno::Reference< lang::XMultiServiceFactory > xFactory )
- : mxFactory( xFactory )
- , mxToplevel( dialog->GetPeerHandle( "dialog" ), uno::UNO_QUERY )
- // FIXME: any of these should work
- //dialog->getContext()->getRoot(), uno::UNO_QUERY )
- // dialog->GetPeer(), uno::UNO_QUERY )
-{
-#if DEBUG_PRINT
- fprintf (stderr, "EditorImpl()\n");
-#endif
- // framework
- mxToolkit = uno::Reference< awt::XToolkit >(
- mxFactory->createInstance(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.Toolkit" ) ) ),
- uno::UNO_QUERY );
- OSL_ASSERT( mxToolkit.is() );
-
- // custom widgets
-#if DEBUG_PRINT
- fprintf (stderr, "custom widgets\n");
-#endif
- mpPropertiesList = new PropertiesList( dialog );
-
- mpLayoutTree = new LayoutTree( dialog );
- mpLayoutTree->setListener( this );
-
-/* if ( xImport.is() )
- mpLayoutTree->getWidget( -1 )->addChild( new Widget( xImport, "import" ) );*/
-
- // create buttons
- layout::Container aWidgets( dialog, "create-widget" );
- layout::Container aContainers( dialog, "create-container" );
- for ( int i = 0; i < WIDGETS_SPECS_LEN; i++ )
- {
- layout::PushButton *pBtn = new layout::PushButton( (layout::Window *) dialog );
- pBtn->SetText( rtl::OUString::createFromAscii( WIDGETS_SPECS[ i ].pLabel ) );
- pBtn->SetClickHdl( LINK( this, EditorImpl, CreateWidgetHdl ) );
- if ( WIDGETS_SPECS[ i ].pIconName != NULL )
- {
- rtl::OString aPath ("cmd/");
- aPath += WIDGETS_SPECS[ i ].pIconName;
- layout::Image aImg( aPath );
- pBtn->SetModeImage( aImg );
- pBtn->SetImageAlign( IMAGEALIGN_LEFT );
- }
- pBtn->Show();
- maCreateButtons.push_back( pBtn );
- layout::Container *pBox = WIDGETS_SPECS[ i ].bIsContainer ? &aContainers : &aWidgets;
- pBox->Add( pBtn );
- }
-
-#ifdef FILEDLG
- fprintf(stderr,"creating file dialog\n");
- pImportDialog = new FileDialog( NULL/*(layout::Window *) dialog*/, 0 );
- fprintf(stderr,"connecting it\n");
- pImportDialog->SetFileSelectHdl( LINK( this, EditorImpl, ImportDialogHdl ) );
- fprintf(stderr,"done file dialog\n");
-#endif
-
-/* pImportButton = new layout::PushButton( dialog, "import-button" );
- pImportButton->SetClickHdl( LINK( this, EditorImpl, ImportButtonHdl ) );*/
- pExportButton = new layout::PushButton( dialog, "export-button" );
- pExportButton->SetClickHdl( LINK( this, EditorImpl, ExportButtonHdl ) );
-}
-
-EditorImpl::~EditorImpl()
-{
- delete mpPropertiesList;
- delete mpLayoutTree;
- for ( std::list< layout::PushButton * >::const_iterator i = maCreateButtons.begin();
- i != maCreateButtons.end(); ++i)
- delete *i;
- delete pImportButton;
- delete pExportButton;
-#ifdef FILEDLG
- delete pImportDialog;
-#endif
-}
-
-void EditorImpl::loadFile( const rtl::OUString &aTestFile )
-{
- fprintf( stderr, "TEST: layout instance\n" );
- uno::Reference< awt::XLayoutRoot > xRoot
- ( new EditorRoot( mxFactory, mpLayoutTree->mpRootWidget ) );
-
-/*
- mxMSF->createInstance
- ( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.Layout")) ),
- uno::UNO_QUERY );
-*/
- if ( !xRoot.is() )
- {
- throw uno::RuntimeException(
- OUString( RTL_CONSTASCII_USTRINGPARAM("could not create awt Layout component!") ),
- uno::Reference< uno::XInterface >() );
- }
-
-#if DEBUG_PRINT
- fprintf( stderr, "TEST: initing root\n" );
-#endif
-
- uno::Reference< lang::XInitialization > xInit( xRoot, uno::UNO_QUERY );
- if ( !xInit.is() )
- {
- throw uno::RuntimeException(
- OUString( RTL_CONSTASCII_USTRINGPARAM("Layout has no XInitialization!") ),
- uno::Reference< uno::XInterface >() );
- }
-
-#if DEBUG_PRINT
- fprintf( stderr, "TEST: running parser\n" );
-#endif
- uno::Sequence< uno::Any > aParams( 1 );
- aParams[0] <<= aTestFile;
-#if DEBUG_PRINT
- fprintf( stderr, "TEST: do it\n" );
-#endif
- xInit->initialize( aParams );
-#if DEBUG_PRINT
- fprintf( stderr, "TEST: file loaded\n" );
-#endif
-
- mpLayoutTree->rebuild();
-}
-
-void EditorImpl::createWidget( const char *name )
-{
- Widget *pWidget = mpLayoutTree->getSelectedWidget();
-
- Widget *pChild = new Widget( rtl::OUString(), mxToolkit, uno::Reference< awt::XLayoutContainer >( mxToplevel, uno::UNO_QUERY ), rtl::OUString::createFromAscii( name ), awt::WindowAttribute::SHOW );
- if ( !pWidget->addChild( pChild ) )
- {
- delete pChild;
- // we may want to popup an error message
- }
- else
- {
- mpLayoutTree->rebuild();
- mpLayoutTree->selectWidget( pWidget );
- }
-}
-
-void EditorImpl::widgetSelected( Widget *pWidget )
-{
- // we know can't add widget to a non-container, so let's disable the create
- // buttons then. Would be nice to have a method to check if a container is
- // full as well...
- if ( !pWidget || pWidget->isContainer() )
- {
- for ( std::list< layout::PushButton *>::const_iterator it = maCreateButtons.begin();
- it != maCreateButtons.end(); ++it)
- (*it)->Enable();
- }
- else
- {
- for ( std::list< layout::PushButton *>::const_iterator it = maCreateButtons.begin();
- it != maCreateButtons.end(); ++it)
- (*it)->Disable();
- }
-
- mpPropertiesList->selectedWidget( pWidget );
-}
-
-IMPL_LINK( EditorImpl, CreateWidgetHdl, layout::Button *, pBtn )
-{
- int i = 0;
- for ( std::list< layout::PushButton *>::const_iterator it = maCreateButtons.begin();
- it != maCreateButtons.end(); ++it, ++i )
- {
- if ( pBtn == *it )
- break;
- }
- OSL_ASSERT( i < WIDGETS_SPECS_LEN );
- createWidget( WIDGETS_SPECS[i].pName );
- return 0;
-}
-
-IMPL_LINK( EditorImpl, ImportButtonHdl, layout::PushButton *, pBtn )
-{
- (void) pBtn;
-#if DEBUG_PRINT
- fprintf(stderr, "IMPORT!\n");
-#endif
-#ifdef FILEDLG
- pImportDialog->Execute();
-#endif
-
- return 0;
-}
-
-#ifdef FILEDLG
-IMPL_LINK( EditorImpl, ImportDialogHdl, FileDialog *, pDialog )
-{
- UniString path = pDialog->GetPath();
-//fprintf(stderr, "Executing import dialog!\n");
-
-#if DEBUG_PRINT
- fprintf(stderr, "got import file: %s\n",rtl::OUStringToOString( path, RTL_TEXTENCODING_ASCII_US ).getStr() );
-#endif
-
- return 0;
-}
-#endif
-
-IMPL_LINK( EditorImpl, ExportButtonHdl, layout::PushButton *, pBtn )
-{
- (void) pBtn;
- mpLayoutTree->print();
- return 0;
-}
-
-//** Editor, the Dialog
-
-Editor::Editor( uno::Reference< lang::XMultiServiceFactory > xFactory,
- rtl::OUString aFile )
- : layout::Dialog( (Window*) (NULL), "editor.xml", "dialog" )
- , mpImpl( new EditorImpl( this, xFactory ) )
-{
- if ( aFile.getLength() )
- mpImpl->loadFile( aFile );
-
- // parent:
- FreeResource();
-}
-
-Editor::~Editor()
-{
- delete mpImpl;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/workben/layout/editor.hxx b/toolkit/workben/layout/editor.hxx
deleted file mode 100644
index c977941703fa..000000000000
--- a/toolkit/workben/layout/editor.hxx
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef EDITOR_HXX
-#define EDITOR_HXX
-
-#include <layout/layout.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-
-class EditorImpl;
-
-class Editor : public layout::Dialog
-{
-EditorImpl *mpImpl;
-
-public:
- Editor( com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > xMSF,
- rtl::OUString aFile );
- ~Editor();
-
- void loadFile( const rtl::OUString &aTestFile );
-};
-
-#endif /*EDITOR_HXX*/
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/workben/layout/editor.xml b/toolkit/workben/layout/editor.xml
deleted file mode 100644
index 4126dea8b289..000000000000
--- a/toolkit/workben/layout/editor.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- Normal skin -->
-
-<dialog xmlns="http://openoffice.org/2007/layout"
- xmlns:cnt="http://openoffice.org/2007/layout/container"
- id="dialog" title="Layout Editor" sizeable="true">
- <vbox>
- <hbox>
- <min-size min-width="120" cnt:expand="false">
- <vbox>
- <fixedtext label="Layout:" cnt:expand="false" />
- <hbox>
- <listbox id="layout-tree" has_border="true" />
- <vbox cnt:expand="false">
- <pushbutton id="layout-up-button" cnt:expand="false" />
- <pushbutton id="layout-down-button" cnt:expand="false" />
- <fixedtext cnt:expand="true" />
- <pushbutton id="layout-remove-button" cnt:expand="false" />
- </vbox>
- </hbox>
- </vbox>
- </min-size>
- <min-size min-width="120">
- <vbox>
- <fixedtext label="Preview:" cnt:expand="false" />
- <vbox border="50">
- <bin id="preview-box" />
- </vbox>
- </vbox>
- </min-size>
- <min-size min-width="120" cnt:expand="false">
- <vbox>
- <fixedtext label="Properties:" cnt:expand="false" />
- <table id="properties-box" columns="3" />
- </vbox>
- </min-size>
- </hbox>
- <hfixedline cnt:expand="false" />
- <vbox cnt:expand="false">
- <fixedtext label="Create widgets:" cnt:expand="false" />
- <flow id="create-widget" homogeneous="true" spacing="2" />
- <fixedtext label="Create containers:" cnt:expand="false" />
- <flow id="create-container" homogeneous="true" spacing="2" />
- </vbox>
- <hbox cnt:expand="false">
- <vbox><fixedline /><fixedline /><fixedline /><fixedline /></vbox>
-<!-- <pushbutton id="import-button" label="Import..." cnt:expand="false"/>-->
- <pushbutton id="export-button" label="Export (stdout)" cnt:expand="false"/>
- </hbox>
- </vbox>
-</dialog>
diff --git a/toolkit/workben/layout/empty.xml b/toolkit/workben/layout/empty.xml
deleted file mode 100644
index a8408e55719e..000000000000
--- a/toolkit/workben/layout/empty.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- This is a template. i18n translation is not performed in-place;
- i18n translated xml files are generated from this template by
- transex3/layout/tralay. !-->
-
-<dialog xmlns="http://openoffice.org/2007/layout"
- xmlns:cnt="http://openoffice.org/2007/layout/container"
- title="Empty Test" optimumsize="true" has_border="true" sizeable="true" moveable="true">
- <vbox spacing="1" border="10">
- <min-size min-width="200"/>
- <fixedline height="1"/>
- <vbox spacing="10">
- <vbox show="false"/>
- <vbox show="false"/>
- <vbox show="false"/>
- <vbox show="false"/>
- <vbox show="false"/>
- <vbox show="false"/>
- <vbox show="false"/>
- <vbox show="false"/>
- <vbox show="false"/>
- <vbox show="false"/>
- </vbox>
- <fixedline height="1"/>
- </vbox>
-</dialog>
diff --git a/toolkit/workben/layout/flow-container.xml b/toolkit/workben/layout/flow-container.xml
deleted file mode 100644
index 3d48b1683216..000000000000
--- a/toolkit/workben/layout/flow-container.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<dialog xmlns="http://openoffice.org/2007/layout"
- xmlns:cnt="http://openoffice.org/2007/layout/container"
- title="Interactable Containers" optimumsize="true"
- has_border="true" sizeable="true" moveable="true">
- <vbox>
- <table columns="3" cnt:title="Page 1">
- <pushbutton cnt:x-expand="false" cnt:row-span="2" label="1,1" />
- <pushbutton cnt:y-expand="false" label="1,2" />
- <pushbutton cnt:y-expand="false" label="1,3" />
- <pushbutton cnt:col-span="2" label="2,1" />
- </table>
- <flow>
- <pushbutton label="label" />
- <pushbutton label="label" />
- <pushbutton label="label" />
- <table columns="3" cnt:title="Page 1">
- <pushbutton cnt:x-expand="false" cnt:row-span="2" label="1,1" />
- <pushbutton cnt:y-expand="false" label="1,2" />
- <pushbutton cnt:y-expand="false" label="1,3" />
- <pushbutton cnt:col-span="2" label="2,1" />
- </table>
- <pushbutton label="label" />
- <pushbutton label="label" />
- <pushbutton label="label" />
- <pushbutton label="label" />
- <pushbutton label="label" />
- </flow>
- <hbox cnt:expand="false">
- <align>
- <okbutton cnt:hfill="0" cnt:halign="0" />
- </align>
- <align>
- <okbutton cnt:hfill="0" cnt:halign="0.3" />
- </align>
- <align>
- <okbutton cnt:hfill="0" cnt:halign="0.5" />
- </align>
- <align>
- <okbutton cnt:hfill="0" cnt:halign="0.7" />
- </align>
- <align>
- <okbutton cnt:hfill="0" cnt:halign="1" />
- </align>
- </hbox>
- </vbox>
-</dialog>
diff --git a/toolkit/workben/layout/flow.xml b/toolkit/workben/layout/flow.xml
deleted file mode 100644
index 03e879bb13c1..000000000000
--- a/toolkit/workben/layout/flow.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<dialog xmlns="http://openoffice.org/2007/layout"
- xmlns:cnt="http://openoffice.org/2007/layout/container"
- title="Flowing" optimumsize="true" has_border="true" sizeable="true" moveable="true">
- <vbox spacing="5">
- <flow>
- <pushbutton label="Button 1" />
- <pushbutton label="Button 2" />
- <pushbutton label="Button 3" />
- <pushbutton label="Button 4" />
- <pushbutton label="Button 5" />
- <pushbutton label="Button 6" />
- <pushbutton label="Button 7" />
- </flow>
- </vbox>
-</dialog>
diff --git a/toolkit/workben/layout/insert-sheet.xml b/toolkit/workben/layout/insert-sheet.xml
deleted file mode 100644
index 2350da9aec77..000000000000
--- a/toolkit/workben/layout/insert-sheet.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- This is a template. i18n translation is not performed in-place;
- i18n translated XML files are generated from this template by
- transex3/layout/tralay. !-->
-
-<modaldialog sizeable="true" closeable="true" moveable="true" output-size="true" id="RID_SCDLG_INSERT_TABLE" sv-look="true" _title="Insert Sheet" xmlns="http://openoffice.org/2007/layout" xmlns:cnt="http://openoffice.org/2007/layout/container">
- <vbox spacing="5" border="5">
- <fixedline id="FL_POSITION" _text="Position"/>
- <hbox>
- <vbox cnt:padding="13" spacing="5">
- <radiobutton radiogroup="insert-sheet-position" id="RB_BEFORE" tabstop="true" _label="B~efore current sheet"/>
- <radiobutton radiogroup="insert-sheet-position" id="RB_BEHIND" tabstop="true" _label="~After current sheet"/>
- </vbox>
- </hbox>
- <fixedline id="FL_TABLE" _text="Sheet"/>
- <hbox>
- <vbox cnt:padding="13" spacing="5">
- <radiobutton radiogroup="insert-sheet-source" id="RB_NEW" _label="~New sheet"/>
- <hbox>
- <vbox cnt:padding="13" spacing="5" cnt:fill="false" cnt:expand="false">
- <fixedtext id="FT_COUNT" _label="N~o. of sheets"/>
- <fixedtext id="FT_NAME" _label="Na~me"/>
- </vbox>
- <vbox>
- <hbox>
- <numericfield has_border="true" maximum="256" minimum="1" repeat="true" id="NF_COUNT" spin="true" spin-size="1" tabstop="true" value="1" cnt:fill="true" cnt:expand="false"/>
- </hbox>
- <edit has_border="true" id="ED_TABNAME" cnt:fill="true" cnt:expand="true"/>
- </vbox>
- </hbox>
- </vbox>
- </hbox>
- <hbox>
- <vbox cnt:padding="13" spacing="5">
- <radiobutton radiogroup="insert-sheet-source" id="RB_FROMFILE" _label="~From file"/>
- <hbox>
- <vbox cnt:padding="13" spacing="5">
- <hbox>
- <multilistbox auto-hscroll="true" has_border="true" id="LB_TABLES" simple-mode="true" string-item-list=" : : : : " cnt:fill="true" cnt:expand="true"/>
- <vbox cnt:fill="false" cnt:expand="false" spacing="5">
- <pushbutton id="BTN_BROWSE" _label="~Browse..." cnt:expand="false"/>
- <checkbox id="CB_LINK" _label="Lin~k" cnt:expand="false"/>
- <flow/>
- </vbox>
- </hbox>
- <fixedtext id="FT_PATH" label="FT-PATH"/>
- </vbox>
- </hbox>
- </vbox>
- </hbox>
- <dialogbuttonhbox border="5" spacing="5">
- <okbutton defbutton="true" id="BTN_OK"/>
- <cancelbutton id="BTN_CANCEL"/>
- <helpbutton id="BTN_HELP"/>
- </dialogbuttonhbox>
- </vbox>
-</modaldialog>
diff --git a/toolkit/workben/layout/interactable-containers.xml b/toolkit/workben/layout/interactable-containers.xml
deleted file mode 100644
index afb663951d6c..000000000000
--- a/toolkit/workben/layout/interactable-containers.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<dialog xmlns="http://openoffice.org/2007/layout"
- xmlns:cnt="http://openoffice.org/2007/layout/container"
- title="Interactable Containers" optimumsize="true"
- has_border="true" sizeable="true" moveable="true">
- <hsplitter>
- <scroller>
- <vbox>
- <pushbutton label="Some Label" />
- <edit has_border="true" text="Some Text" />
- <listbox has_border="true" string-item-list="Item One:Item Two:Item Three:Item Four:Item Five:Item Six:Item Seven" />
- <combobox has_border="true" string-item-list="Item One:Item Two:Item Three" />
- <pushbutton label="Some Label" />
- <pushbutton label="Some Label" />
- <pushbutton label="Some Label" />
- <pushbutton label="Some Label" />
- <pushbutton label="Some Label" />
- <pushbutton label="Some Label" />
- <pushbutton label="Some Label" />
- <pushbutton label="Some Label" />
- <pushbutton label="Some Label" />
- <pushbutton label="Some Label" />
- <pushbutton label="Some Label" />
- <pushbutton label="Some Label" />
- </vbox>
- </scroller>
- <vsplitter>
- <pushbutton label="Corner" />
- <tabcontrol>
- <table columns="3" cnt:title="Page 1">
- <pushbutton cnt:x-expand="false" cnt:row-span="2" label="1,1" />
- <pushbutton cnt:y-expand="false" label="1,2" />
- <pushbutton cnt:y-expand="false" label="1,3" />
- <pushbutton cnt:col-span="2" label="2,1" />
- </table>
- <vbox cnt:title="Page 2">
- <pushbutton label="1" />
- <pushbutton label="2" />
- <pushbutton label="3" />
- <pushbutton label="4" />
- </vbox>
- <pushbutton label="Content 3" cnt:title="Page 3" />
- <pushbutton label="Content 4" cnt:title="Page 4" />
- <pushbutton label="Content 5" cnt:title="Page 5" />
- </tabcontrol>
- </vsplitter>
- </hsplitter>
-</dialog>
diff --git a/toolkit/workben/layout/layout-flat.xml b/toolkit/workben/layout/layout-flat.xml
deleted file mode 100644
index 0d3b969020fb..000000000000
--- a/toolkit/workben/layout/layout-flat.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<framewindow xmlns="http://openoffice.org/2007/layout"
- id="window1" title="Test-Dialog" optimumsize="true"
- has_border="true" sizeable="true" moveable="true"
- width="800" height="300">
- <pushbutton label="XML Left" toggle="true" show="true"
- x="10" y="10" width="400" height="200"/>
- <pushbutton label="XML Right" toggle="true" show="true"
- x="420" y="10" width="400" height="200"/>
- <checkbox label="XML cool ?" enabled="true" show="true"
- state="1" tristate="true" align="1"
- x="10" y="210" width="800" height="100"/>
-</framewindow> \ No newline at end of file
diff --git a/toolkit/workben/layout/layout.xml b/toolkit/workben/layout/layout.xml
deleted file mode 100644
index 4d9e71bbc5b9..000000000000
--- a/toolkit/workben/layout/layout.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<dialog xmlns="http://openoffice.org/2007/layout"
- xmlns:cnt="http://openoffice.org/2007/layout/container"
- id="window1" title="Test-Dialog" optimumsize="true"
- has_border="true" sizeable="true" moveable="true">
- <hbox border="20" spacing="10" homogeneous="true">
- <pushbutton label="XML Left"
- cnt:expand="true" cnt:fill="true" />
- <pushbutton label="XML Center"
- cnt:expand="true" cnt:fill="false" />
- <pushbutton label="XML Right"
- cnt:expand="false" cnt:fill="false" />
- </hbox>
-</dialog>
diff --git a/toolkit/workben/layout/message-box.xml b/toolkit/workben/layout/message-box.xml
deleted file mode 100644
index 2bd19bbb42fb..000000000000
--- a/toolkit/workben/layout/message-box.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- This is a template. i18n translation is not performed in-place;
- i18n translated xml files are generated from this template by
- transex3/layout/tralay. !-->
-
-<modaldialog xmlns="http://openoffice.org/2007/layout"
- xmlns:cnt="http://openoffice.org/2007/layout/container"
- id="message-box" _title="" optimumsize="true"
- has_border="true" sizeable="true" moveable="true" closeable="true">
- <vbox border="5" spacing="5">
- <hbox border="5" spacing="20">
- <align cnt:expand="false" cnt:fill="true">
- <fixedimage id="FI_ERROR" cnt:expand="false" cnt:v-align="0.5" cnt:v-fill="0" graphic="cmd/msgbox-error.png" />
- </align>
- <align cnt:expand="false" cnt:fill="true">
- <fixedimage id="FI_INFO" cnt:expand="false" cnt:v-align="0.5" cnt:v-fill="0" graphic="cmd/msgbox-info.png" />
- </align>
- <align cnt:expand="false" cnt:fill="true">
- <fixedimage id="FI_QUERY" cnt:expand="false" cnt:v-align="0.5" cnt:v-fill="0" graphic="cmd/msgbox-query.png" />
- </align>
- <align cnt:expand="false" cnt:fill="true">
- <fixedimage id="FI_WARNING" cnt:expand="false" cnt:v-align="0.5" cnt:v-fill="0" graphic="cmd/msgbox-warning.png" />
- </align>
- <align cnt:expand="false" cnt:fill="true">
- <fixedtext id="FT_MESSAGE" _label="FT-LABEL" cnt:v-align="0.5" cnt:v-fill="0" />
- </align>
- <flow/>
- </hbox>
- <dialogbuttonhbox border="0" spacing="5">
- <flow/>
- <!-- deprecoted vcl/MsgBox compatibility !-->
- <retrybutton id="BTN_RETRY" />
- <ignorebutton id="BTN_IGNORE" />
-
- <yesbutton id="BTN_YES"/>
- <cancelbutton id="BTN_CANCEL"/>
- <helpbutton id="BTN_HELP"/>
- <nobutton id="BTN_NO" xlabel="~Alternate"/>
- </dialogbuttonhbox>
- </vbox>
-</modaldialog>
diff --git a/toolkit/workben/layout/more.xml b/toolkit/workben/layout/more.xml
deleted file mode 100644
index 79e9c8214356..000000000000
--- a/toolkit/workben/layout/more.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<modaldialog xmlns="http://openoffice.org/2007/layout"
- xmlns:cnt="http://openoffice.org/2007/layout/container"
- id="RID_SVXDLG_MORE" _title="Test More" optimumsize="true"
- help-id="SID_ATTR_RESTORE"
- has_border="true" sizeable="true" moveable="true">
- <vbox spacing="5" border="5" width="640">
- <fixedtext id="FT_ONE" _label="One"/>
- <fixedtext id="FT_TWO" _label="Two"/>
- <hbox border="5">
- <flow/>
- <morebutton id="PB_MORE" cnt:expand="false" _label="More..."/>
- </hbox>
- <fixedtext id="FT_THREE" _label="Three"/>
- <fixedtext id="FT_FOUR" _label="Four"/>
- </vbox>
-</modaldialog>
-
diff --git a/toolkit/workben/layout/move-copy-sheet.xml b/toolkit/workben/layout/move-copy-sheet.xml
deleted file mode 100644
index 3d26db1aa73d..000000000000
--- a/toolkit/workben/layout/move-copy-sheet.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- This is a template. i18n translation is not performed in-place;
- i18n translated XML files are generated from this template by
- transex3/layout/tralay. !-->
-
-<modaldialog sizeable="true" closeable="true" help-id="FID_TAB_MOVE" moveable="true" output-size="true" id="RID_SCDLG_MOVETAB" sv-look="true" _title="Move/Copy Sheet" xmlns="http://openoffice.org/2007/layout" xmlns:cnt="http://openoffice.org/2007/layout/container">
- <vbox spacing="5" border="5">
- <string id="STR_NEWDOC" _text="- new document -"/>
- <fixedtext id="FT_DEST" _label="To ~document"/>
- <listbox has_border="true" dropdown="true" id="LB_DEST" tabstop="true"/>
- <fixedtext id="FT_INSERT" _label="~Insert before"/>
- <listbox has_border="true" id="LB_INSERT" tabstop="true" string-item-list=" : : : : " />
- <checkbox id="BTN_COPY" tabstop="true" _label="~Copy"/>
- <dialogbuttonhbox border="5" spacing="5">
- <flow/>
- <cancelbutton id="BTN_CANCEL" tabstop="true"/>
- <helpbutton id="BTN_HELP" tabstop="true"/>
- <okbutton defbutton="true" id="BTN_OK" tabstop="true"/>
- </dialogbuttonhbox>
- </vbox>
-</modaldialog>
diff --git a/toolkit/workben/layout/non-interactable-containers.xml b/toolkit/workben/layout/non-interactable-containers.xml
deleted file mode 100644
index 29b37b6a7a49..000000000000
--- a/toolkit/workben/layout/non-interactable-containers.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<dialog xmlns="http://openoffice.org/2007/layout"
- xmlns:cnt="http://openoffice.org/2007/layout/container"
- title="Interactable Containers" optimumsize="true"
- has_border="true" sizeable="true" moveable="true">
- <vbox spacing="10">
- <table columns="3" cnt:title="Page 1">
- <pushbutton cnt:x-expand="false" cnt:row-span="2" label="1,1" />
- <pushbutton cnt:y-expand="false" label="1,2" />
- <pushbutton cnt:y-expand="false" label="1,3" />
- <pushbutton cnt:col-span="2" label="2,1" />
- </table>
- <hfixedline/>
- <flow cnt:expand="false">
- <pushbutton label="label" />
- <pushbutton label="label" />
- <pushbutton label="label" />
- <table columns="3" cnt:title="Page 1">
- <pushbutton cnt:x-expand="false" cnt:row-span="2" label="1,1" />
- <pushbutton cnt:y-expand="false" label="1,2" />
- <pushbutton cnt:y-expand="false" label="1,3" />
- <pushbutton cnt:col-span="2" label="2,1" />
- </table>
- <pushbutton label="label" />
- <pushbutton label="label" />
- <pushbutton label="label" />
- <pushbutton label="label" />
- <pushbutton label="label" />
- </flow>
- <hfixedline/>
- <hbox cnt:expand="false">
-<!-- <align>
- <okbutton cnt:hfill="0.2" cnt:halign="0.2" />
- </align>
- <align>
- <okbutton cnt:hfill="0.8" cnt:halign="0.2" />
- </align>-->
- </hbox>
- </vbox>
-</dialog>
diff --git a/toolkit/workben/layout/number-format.xml b/toolkit/workben/layout/number-format.xml
deleted file mode 100644
index 77460ea79ceb..000000000000
--- a/toolkit/workben/layout/number-format.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- This is a template. i18n translation is not performed in-place;
- i18n translated XML files are generated from this template by
- transex3/layout/tralay. !-->
-
-<tabpage help-id="HID_NUMBERFORMAT" show="false" id="RID_SVXPAGE_NUMBERFORMAT" _title="Number Format" _text="Number Format" xmlns="http://openoffice.org/2007/layout" xmlns:cnt="http://openoffice.org/2007/layout/container" sizeable="true">
- <!--
- <imagelist prefix="nu" id="IL_ICON">
- <maskcolor blue="0xFFFF" green="0x0000" red="0xFFFF" type="Color"/>
- <idlist none="IID_INFO"/>
- <idcount none="3"/>
- </imagelist>
- !-->
- <vbox spacing="5" border="5">
- <string id="STR_EUROPE" _text="Europe"/>
- <string id="STR_AUTO_ENTRY" _text="Automatic"/>
- <hbox spacing="5">
- <vbox spacing="5" cnt:fill="true" cnt:expand="true">
- <fixedtext id="FT_CATEGORY" _label="~Category"/>
- <listbox line-count="8" auto-hscroll="true" has_border="true" id="LB_CATEGORY" _string-item-list="All:User-defined:Number:Percent:Currency:Date:Time:Scientific:Fraction:Boolean Value:Text"/>
- <flow/>
- </vbox>
- <vbox spacing="5" cnt:fill="true" cnt:expand="true">
- <fixedtext id="FT_FORMAT" _label="F~ormat"/>
- <listbox has_border="true" line-count="7" dropdown="true" id="LB_CURRENCY" tabstop="true" _string-item-list="Automatically" cnt:expand="false" cnt:fill="false"/>
- <svxfontlistbox line-count="7" dropdown="false" has_border="true" help-id="HID_NUMBERFORMAT_LB_FORMAT" id="LB_FORMAT" tabstop="true" string-item-list=" : : : : : : : : : : : : : : : "/>
- </vbox>
- <vbox spacing="5" cnt:fill="true" cnt:expand="true">
- <fixedtext id="FT_LANGUAGE" _label="~Language" cnt:expand="false" cnt:fill="false"/>
- <svxlanguagebox has_border="true" dropdown="true" id="LB_LANGUAGE" sort="true" string-item-list="Dutch:" cnt:expand="false" cnt:fill="false"/>
- <checkbox id="CB_SOURCEFORMAT" show="false" _label="So~urce format" cnt:expand="false" cnt:fill="false"/>
- <flow cnt:expand="true" cnt:fill="true"/>
- <window has_border="true" help-id="HID_NUMBERFORMAT_WND_NUMBER_PREVIEW" id="WND_NUMBER_PREVIEW" sv-look="true"/>
- </vbox>
- </hbox>
- <fixedline id="FL_OPTIONS" _text="Options"/>
- <hbox>
- <vbox cnt:padding="13" spacing="5">
- <hbox spacing="5">
- <vbox spacing="5" cnt:fill="false" cnt:expand="false">
- <fixedtext id="FT_DECIMALS" _label="~Decimal places"/>
- <fixedtext id="FT_LEADZEROES" _label="Leading ~zeroes"/>
- </vbox>
- <vbox spacing="5" cnt:fill="false" cnt:expand="false">
- <numericfield has_border="true" first="0" last="15" minimum="0" value="2" maximum="20" repeat="true" id="ED_DECIMALS" spin="true" spin-size="1" strict-format="true" cnt:expand="false"/>
- <numericfield has_border="true" first="0" last="15" minimum="0" value="1" maximum="20" repeat="true" id="ED_LEADZEROES" spin="true" spin-size="1" strict-format="true" cnt:fill="false"/>
- </vbox>
- <vbox spacing="5" cnt:fill="false" cnt:expand="false">
- <checkbox id="BTN_NEGRED" _label="~Negative numbers red"/>
- <checkbox id="BTN_THOUSAND" _label="~Thousands separator"/>
- </vbox>
- </hbox>
- </vbox>
- </hbox>
- <fixedtext id="FT_EDFORMAT" _label="~Format code"/>
- <hbox spacing="5" cnt:expand="false">
- <edit has_border="true" id="ED_FORMAT"/>
- <imagebutton cnt:expand="false" cnt:fill="false" help-id="HID_NUMBERFORMAT_TBI_ADD" quick-help-text="Add" id="IB_ADD" sv-look="true" graphic="svx/res/nu01.png"/>
- <imagebutton cnt:expand="false" help-id="HID_NUMBERFORMAT_TBI_INFO" quick-help-text="Edit Comment" id="IB_INFO" sv-look="true" graphic="svx/res/nu03.png"/>
- <imagebutton cnt:expand="false" help-id="HID_NUMBERFORMAT_TBI_REMOVE" quick-help-text="Remove" id="IB_REMOVE" sv-look="true" graphic="svx/res/nu02.png"/>
- </hbox>
- <fixedtext no-label="true" show="false" id="FT_COMMENT" word-break="true" cnt:expand="false"/>
- <edit has_border="true" show="false" id="ED_COMMENT" cnt:expand="false"/>
- </vbox>
-</tabpage>
diff --git a/toolkit/workben/layout/numeric.xml b/toolkit/workben/layout/numeric.xml
deleted file mode 100644
index becab18cdf9b..000000000000
--- a/toolkit/workben/layout/numeric.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<framewindow xmlns="http://openoffice.org/2007/layout"
- xmlns:cnt="http://openoffice.org/2007/layout/container"
- id="window1" title="Test-Dialog" optimumsize="true"
- has_border="true" sizeable="true" moveable="true">
- <vbox>
- <numericfield text="5" spin="true" enforce-format="false" value-min="5.3" value-max="17.8"/>
- <pushbutton />
- </vbox>
-</framewindow>
diff --git a/toolkit/workben/layout/ooo-patch b/toolkit/workben/layout/ooo-patch
deleted file mode 100644
index 89fc58db8748..000000000000
--- a/toolkit/workben/layout/ooo-patch
+++ /dev/null
@@ -1,7 +0,0 @@
-#! /bin/sh
-commit=${1-3249db59} # m5
-
-git diff $commit layout | sed 's@^\([+-]\{3\}\) \(a\|b\)/@\1 @' > layout-dialogs-layout.diff
-git diff $commit config_office scp2 | sed 's@^\([+-]\{3\}\) \(a\|b\)/@\1 @' > layout-dialogs-config_office-scp2.diff
-git diff $commit svx sw | sed 's@^\([+-]\{3\}\) \(a\|b\)/@\1 @' > layout-dialogs-svx-sw.diff
-git diff $commit transex3 | sed 's@^\([+-]\{3\}\) \(a\|b\)/@\1 @' > layout-dialogs-transex3.diff
diff --git a/toolkit/workben/layout/paragraph.xml b/toolkit/workben/layout/paragraph.xml
deleted file mode 100644
index 847e04ec0568..000000000000
--- a/toolkit/workben/layout/paragraph.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<dialog xmlns="http://openoffice.org/2007/layout"
- xmlns:cnt="http://openoffice.org/2007/layout/container"
- id="dialog" title="Paragraph" optimumsize="true"
- has_border="true" sizeable="true" moveable="true">
-<vbox>
- <tabcontrol>
- <vbox cnt:title="Indents and Spacing">
- <hbox cnt:expand="false">
- <fixedtext id="FL_INDENT" label="Indent" cnt:expand="false" />
- <fixedline />
- </hbox>
- <table columns="2" cnt:expand="false">
- <fixedtext id="FT_LEFTINDENT" label="Before text" />
- <metricfield id="ED_LEFTINDENT" spin="true" has_border="true"/>
- <fixedtext id="FT_RIGHTINDENT" label="After text" />
- <metricfield id="ED_RIGHTINDENT" spin="true" has_border="true"/>
- <fixedtext id="FT_FLINEINDENT" label="First line" />
- <metricfield id="ED_FLINEINDENT" spin="true" has_border="true" />
- <checkbox id="CB_AUTO" label="Automatic" cnt:col-span="2" />
- </table>
- <hbox cnt:expand="false">
- <fixedtext id="FL_DIST" label="Spacing" cnt:expand="false" />
- <fixedline />
- </hbox>
- <table columns="2" cnt:expand="false">
- <fixedtext id="FT_TOPDIST" label="Above paragraph" />
- <numericfield id="ED_TOPDIST" spin="true" has_border="true" />
- <fixedtext id="FT_BOTTOMDIST" label="Below paragraph" />
- <numericfield id="ED_BOTTOMDIST" spin="true" has_border="true" />
- </table>
- <hbox cnt:expand="false">
- <fixedtext id="FL_LINEDIST" label="Line spacing" cnt:expand="false" />
- <fixedline />
- </hbox>
- <hbox cnt:expand="false">
- <listbox id="LB_LINEDIST" dropdown="true"
- string-item-list="Single:1.5 lines:Double:Proportional"
- cnt:expand="false"/>
- <fixedtext id="FT_LINEDIST" label="of" cnt:expand="true" />
- <numericfield id="ED_LINEDISTPERCENT" value="0" />
- </hbox>
- <hbox id="FL_REGISTER" cnt:expand="false">
- <fixedtext label="Register-true" cnt:expand="false" />
- <fixedline />
- </hbox>
- <checkbox id="CB_REGISTER" cnt:expand="false" label="Activate" />
- </vbox>
-
- <vbox cnt:title="Alignment">
- <hbox cnt:expand="false">
- <fixedtext id="FL_ALIGN" label="Options" cnt:expand="false" />
- <fixedline />
- </hbox>
- <radiobutton id="BTN_LEFTALIGN" label="Left" cnt:expand="false" />
- <radiobutton id="BTN_RIGHTALIGN" label="Right" cnt:expand="false" />
- <radiobutton id="BTN_CENTERALIGN" label="Center" cnt:expand="false" />
- <radiobutton id="BTN_JUSTIFYALIGN" label="Justify" cnt:expand="false" />
- <hbox cnt:expand="false">
- <fixedtext id="FL_ALIGN" label="Last line" cnt:expand="false" />
- <listbox dropdown="true" string-item-list="Left:Centered:Justified"
- id="LB_LASTLINE" />
- </hbox>
- </vbox>
- </tabcontrol>
-
- <align cnt:expand="false">
- <hbox cnt:expand="false" cnt:hfill="0" cnt:halign="1">
- <pushbutton label="OK" />
- <pushbutton label="Cancel" />
- <pushbutton label="Help" />
- <pushbutton label="Reset" />
- </hbox>
- </align>
-</vbox>
-</dialog>
diff --git a/toolkit/workben/layout/plugin.cxx b/toolkit/workben/layout/plugin.cxx
deleted file mode 100644
index 65af2e510021..000000000000
--- a/toolkit/workben/layout/plugin.cxx
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#define _LAYOUT_PLUGIN_CXX
-
-#include "plugin.hxx"
-
-#include <com/sun/star/awt/XDialog2.hpp>
-#include <dialcontrol.hxx>
-#include <toolkit/awt/vclxwindow.hxx>
-
-#include <layout/layout-pre.hxx>
-
-using namespace com::sun::star;
-
-#define LAYOUT_RES(x) #x
-
-#undef ModalDialog
-#define ModalDialog( parent, id ) Dialog( parent, "plugin.xml", id )
-
-PluginDialog::PluginDialog( Window* pParent )
- : ModalDialog( pParent, LAYOUT_RES( RID_DLG_PLUGIN ) )
- , aHeaderImage( this, LAYOUT_RES( FI_HEADER ) )
- , aHeaderText( this, LAYOUT_RES( FT_HEADER ) )
- , aHeaderLine( this, LAYOUT_RES( FL_HEADER ) )
- , aPlugin( this, LAYOUT_RES( PL_DIAL ),
-// FIXME: width=, height=, are not recognized as properties.
-// new svx::DialControl( LAYOUT_DIALOG_PARENT, Size( 0, 0 ), 0 ) )
- new svx::DialControl( LAYOUT_DIALOG_PARENT, Size( 80, 80 ), 0 ) )
- //, aDialControl( static_cast<svx::DialControl&> ( aPlugin.GetPlugin() ) )
- , aDialControl( static_cast<svx::DialControl&> ( *aPlugin.mpPlugin ) )
- , aOKBtn( this, LAYOUT_RES( BTN_OK ) )
- , aCancelBtn( this, LAYOUT_RES( BTN_CANCEL ) )
- , aHelpBtn( this, LAYOUT_RES( BTN_HELP ) )
-{
- aDialControl.SetRotation( 425 );
-}
-
-PluginDialog::~PluginDialog()
-{
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/workben/layout/plugin.hxx b/toolkit/workben/layout/plugin.hxx
deleted file mode 100644
index 862e6f6dc85a..000000000000
--- a/toolkit/workben/layout/plugin.hxx
+++ /dev/null
@@ -1,59 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _LAYOUT_PLUGIN_HXX
-#define _LAYOUT_PLUGIN_HXX
-
-#include <layout/layout.hxx>
-#include <layout/layout-pre.hxx>
-
-namespace svx {
-class DialControl;
-}
-
-class PluginDialog : public ModalDialog
-{
-private:
- FixedImage aHeaderImage;
- FixedText aHeaderText;
- FixedLine aHeaderLine;
- Plugin aPlugin;
- svx::DialControl& aDialControl;
- OKButton aOKBtn;
- CancelButton aCancelBtn;
- HelpButton aHelpBtn;
-
-public:
- PluginDialog( Window* pParent );
- ~PluginDialog();
-};
-
-#include <layout/layout-post.hxx>
-
-#endif /* _LAYOUT_PLUGIN_HXX */
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/workben/layout/plugin.xml b/toolkit/workben/layout/plugin.xml
deleted file mode 100644
index 5303e3a2329e..000000000000
--- a/toolkit/workben/layout/plugin.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- This is a template. i18n translation is not performed in-place;
- i18n translated xml files are generated from this template by
- transex3/layout/tralay. !-->
-
-<modaldialog xmlns="http://openoffice.org/2007/layout"
- xmlns:cnt="http://openoffice.org/2007/layout/container"
- id="RID_DLG_PLUGIN" _title="Plugin Test" optimumsize="true"
- help-id="SID_ATTR_PLUGIN"
- has_border="true" sizeable="true" moveable="true">
- <vbox spacing="5" border="5">
- <hbox spacing="5" cnt:expand="false">
- <fixedimage id="FI_HEADER" cnt:expand="false" graphic="cmd/sc_apply.png" />
- <fixedtext id="FT_HEADER" _label="Plugin Test"/>
- </hbox>
- <fixedline id="FL_HEADER"/>
- <hbox>
- <flow cnt:padding="80"/>
- <plugin id="PL_DIAL" width="80" height="80"/>
- </hbox>
- <dialogbuttonhbox border="5" spacing="5">
- <flow/>
- <okbutton defbutton="true" id="BTN_OK"/>
- <cancelbutton id="BTN_CANCEL" />
- <helpbutton id="BTN_HELP"/>
- </dialogbuttonhbox>
- </vbox>
-</modaldialog>
-
diff --git a/toolkit/workben/layout/radio-groups.xml b/toolkit/workben/layout/radio-groups.xml
deleted file mode 100644
index 43a1372297ee..000000000000
--- a/toolkit/workben/layout/radio-groups.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<dialog xmlns="http://openoffice.org/2007/layout"
- xmlns:cnt="http://openoffice.org/2007/layout/container"
- title="Radio Groups Test"
- optimumsize="true" has_border="true" sizeable="true" moveable="true">
- <vbox>
- <hbox>
- <radiobutton group="1" label="Group 1"
- cnt:expand="false" cnt:fill="false" />
- <radiobutton group="2" label="Group 2"
- cnt:expand="true" cnt:fill="true" />
- <radiobutton group="2" label="Group 2"
- cnt:expand="true" cnt:fill="false" />
- <radiobutton group="1" label="Group 1 (default)" state="1"
- cnt:expand="false" cnt:fill="false" />
- </hbox>
- <radiobutton group="1" label="Group 1" state="0"
- cnt:expand="false" cnt:fill="false" />
- </vbox>
-</dialog>
diff --git a/toolkit/workben/layout/recover.cxx b/toolkit/workben/layout/recover.cxx
deleted file mode 100644
index c776ec0bd8d2..000000000000
--- a/toolkit/workben/layout/recover.cxx
+++ /dev/null
@@ -1,113 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-#if TEST_LAYOUT
-#include <cstdio>
-#endif /* TEST_LAYOUT */
-#include <com/sun/star/awt/XDialog2.hpp>
-#include <tools/shl.hxx>
-#include <svtools/itemset.hxx>
-#include <svtools/itempool.hxx>
-#include <sfx2/objsh.hxx>
-#include <vcl/msgbox.hxx>
-#include <toolkit/awt/vclxwindow.hxx>
-
-
-#include <com/sun/star/awt/PosSize.hpp> //redrawAlready
-
-using namespace com::sun::star;
-
-#define _SVX_RECOVER_CXX
-
-#include "recover.hxx"
-
-#include <layout/layout-pre.hxx>
-
-#if ENABLE_LAYOUT
-#undef SVX_RES
-#define SVX_RES(x) #x
-#undef SfxModalDialog
-#define SfxModalDialog( parent, id ) Dialog( parent, "recover.xml", id )
-#endif /* ENABLE_LAYOUT */
-
-#if TEST_LAYOUT
-SvxRecoverDialog::SvxRecoverDialog( Window* pParent )
-#else /* !TEST_LAYOUT */
-SvxRecoverDialog::SvxRecoverDialog( Window* pParent, const SfxItemSet& rCoreSet )
-#endif /* !TEST_LAYOUT */
-: SfxModalDialog( pParent, SVX_RES( RID_SVXDLG_RECOVER ) )
-
- , aHeaderImage( this, SVX_RES( FI_HEADER ) )
- , aHeaderText( this, SVX_RES( FT_HEADER ) )
- , aHeaderLine( this, SVX_RES( FL_HEADER ) )
- , aRecoverText( this, SVX_RES( FT_RECOVER ) )
- , aTextAdvanced( this, SVX_RES( FT_ADVANCED ) )
-
- , aCheckBoxDoc( this, SVX_RES( CB_DOC ) )
- , aImageDoc( this, SVX_RES( FI_DOC ) )
- , aTextDoc( this, SVX_RES( FT_DOC ) )
-
- , aCheckBoxSheet( this, SVX_RES( CB_SHEET ) )
- , aImageSheet( this, SVX_RES( FI_SHEET ) )
- , aTextSheet( this, SVX_RES( FT_SHEET ) )
-
- , aCheckBoxDraw( this, SVX_RES( CB_DRAW ) )
- , aImageDraw( this, SVX_RES( FI_DRAW ) )
- , aTextDraw( this, SVX_RES( FT_DRAW ) )
-
- , aCheckBoxPresent( this, SVX_RES( CB_PRESENT ) )
- , aImagePresent( this, SVX_RES( FI_PRESENT ) )
- , aTextPresent( this, SVX_RES( FT_PRESENT ) )
-
- , aButtonAdvanced( this, SVX_RES( PB_ADVANCED ) )
-
- , aProgressText( this, SVX_RES( FT_PROGRESS ) )
- , aProgressBar( this, SVX_RES( PB_RECOVER ) )
- , aCheckBoxLogFile( this, SVX_RES( CH_LOGFILE ) )
- , aOKBtn( this, SVX_RES( BTN_OK ) )
- , aCancelBtn( this, SVX_RES( BTN_CANCEL ) )
- , aHelpBtn( this, SVX_RES( BTN_HELP ) )
-{
- aButtonAdvanced.AddAdvanced( &aTextAdvanced );
- aButtonAdvanced.AddAdvanced( &aCheckBoxDoc );
- aButtonAdvanced.AddAdvanced( &aCheckBoxSheet );
- aButtonAdvanced.AddAdvanced( &aCheckBoxDraw );
- aButtonAdvanced.AddAdvanced( &aCheckBoxPresent );
- aButtonAdvanced.AddAdvanced( &aCheckBoxLogFile );
-}
-
-
-SvxRecoverDialog::~SvxRecoverDialog()
-{
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/workben/layout/recover.hxx b/toolkit/workben/layout/recover.hxx
deleted file mode 100644
index de3a63c84510..000000000000
--- a/toolkit/workben/layout/recover.hxx
+++ /dev/null
@@ -1,81 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_RECOVER_HXX
-#define _SVX_RECOVER_HXX
-
-#include <layout/layout.hxx>
-#include <vcl/button.hxx>
-#include <vcl/field.hxx>
-#include <vcl/fixed.hxx>
-#include <layout/core/box.hxx>
-#include <layout/layout-pre.hxx>
-
-class SvxRecoverDialog : public SfxModalDialog
-{
-private:
- FixedImage aHeaderImage;
- FixedText aHeaderText;
- FixedLine aHeaderLine;
- FixedText aRecoverText;
- FixedText aTextAdvanced;
-
- CheckBox aCheckBoxDoc;
- FixedImage aImageDoc;
- FixedText aTextDoc;
- CheckBox aCheckBoxSheet;
- FixedImage aImageSheet;
- FixedText aTextSheet;
- CheckBox aCheckBoxDraw;
- FixedImage aImageDraw;
- FixedText aTextDraw;
- CheckBox aCheckBoxPresent;
- FixedImage aImagePresent;
- FixedText aTextPresent;
- AdvancedButton aButtonAdvanced;
-
- FixedText aProgressText;
- ProgressBar aProgressBar;
- CheckBox aCheckBoxLogFile;
- OKButton aOKBtn;
- CancelButton aCancelBtn;
- HelpButton aHelpBtn;
-
-public:
-#if TEST_LAYOUT
- SvxRecoverDialog( Window* pParent );
-#else /* !TEST_LAYOUT */
- SvxRecoverDialog( Window* pParent, const SfxItemSet& rCoreSet );
-#endif /* !TEST_LAYOUT */
- ~SvxRecoverDialog();
-};
-
-#include <layout/layout-post.hxx>
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/workben/layout/recover.xml b/toolkit/workben/layout/recover.xml
deleted file mode 100644
index 790a6b694658..000000000000
--- a/toolkit/workben/layout/recover.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- This is a template. i18n translation is not performed in-place;
- i18n translated xml files are generated from this template by
- transex3/layout/tralay. !-->
-
-<modaldialog xmlns="http://openoffice.org/2007/layout"
- xmlns:cnt="http://openoffice.org/2007/layout/container"
- id="RID_SVXDLG_RECOVER" _title="OpenOffice.org Document Restore -- questions to sigi(at)novell.com--" optimumsize="true"
- help-id="SID_ATTR_RESTORE"
- has_border="true" sizeable="true" moveable="true">
- <vbox spacing="5" border="5" width="640">
- <hbox spacing="5" cnt:expand="false">
- <fixedimage id="FI_HEADER" cnt:expand="false" graphic="cmd/sc_apply.png" />
- <fixedtext id="FT_HEADER" _label="OpenOffice.org Document Restore"/>
- </hbox>
- <fixedline id="FL_HEADER"/>
- <!-- mockup: fixedtext multiline=true" does not work?
- <multilineedit id="MLE_RECOVER" has_border="false" foobar="x" _text="At least one document was found that was not stored safely to the media. Uncheck any documents you do not want to restore (information may be lost)."/>
- <fixedtext id="FT_RECOVER" has_border="false" multi-line="true" font-word-line-mode="true" word-break="true" _label="At least one document was found that was not stored safely to the media. Uncheck any documents you do not want to restore (information may be lost).
-LINE TEST"/>
- !-->
- <fixedtext id="FT_RECOVER" has_border="false" multi-line="true" font-word-line-mode="true" _label="At least one document was not stored safely and must be recovered."/>
- <fixedtext id="FT_ADVANCED" has_border="false" multi-line="true" font-word-line-mode="true" word-break="true" _label="Uncheck any documents you do not want to restore (information may be lost)."/>
- <vbox cnt:fill="true" cnt:expand="true" cnt:padding="20" border="20" spacing="20">
- <hbox>
- <checkbox id="CB_DOC" state="1" cnt:expand="false" scale="false"/>
- <fixedimage id="FI_DOC" cnt:v-align="0.5" image-align="0.5" cnt:expand="false" scale="false" graphic="cmd/lc_insertdoc.png"/>
- <fixedtext id="FT_DOC" _label="My document"/>
- </hbox>
- <hbox>
- <checkbox id="CB_SHEET" state="1" cnt:expand="false" scale="false" />
- <fixedimage id="FI_SHEET" cnt:expand="false" scale="false" graphic="cmd/lc_inserttable.png" />
- <fixedtext id="FT_SHEET" _label="My spreadsheet"/>
- </hbox>
- <hbox>
- <checkbox id="CB_DRAW" state="1" cnt:expand="false" scale="false"/>
- <fixedimage id="FI_DRAW" cnt:expand="false" scale="false" graphic="cmd/lc_insertdraw.png" />
- <fixedtext id="FT_DRAW" _label="My drawing"/>
- </hbox>
- <hbox>
- <checkbox id="CB_PRESENT" state="1" cnt:expand="false" scale="false" />
- <fixedimage id="FI_PRESENT" cnt:expand="false" scale="false" graphic="cmd/lc_insertvideo.png" />
- <fixedtext id="FT_PRESENT" _label="My presentation"/>
- </hbox>
- <hbox border="5">
- <flow/>
- <advancedbutton id="PB_ADVANCED" cnt:expand="false" _label="Advanced..."/>
- </hbox>
- </vbox>
- <vbox>
- <fixedtext id="FT_PROGRESS" _label="Restore progress (idle)"/>
- <hbox height="40" cnt:expand="true">
- <progressbar cnt:expand="true" cnt:fill="true" id="PB_RECOVER" has_border="true" border="10" fill-color="#ccccff" background-color="#ffffff" progress-value-min="0" progress-value-max="100" progress-value="50" />
- <!-- FIXME: cannot set progress bar's height, use space as strut... !-->
- <fixedtext label="" height="10" cnt:expand="false" cnt:fill="false"/>
- </hbox>
- </vbox>
- <checkbox id="CH_LOGFILE" _label="Open additional text document to display the restore logfile"/>
- <dialogbuttonhbox border="5" spacing="5">
- <flow/>
- <okbutton defbutton="true" id="BTN_OK" _label="Restore"/>
- <cancelbutton id="BTN_CANCEL" />
- <helpbutton id="BTN_HELP"/>
- </dialogbuttonhbox>
- </vbox>
-</modaldialog>
-
diff --git a/toolkit/workben/layout/refresh b/toolkit/workben/layout/refresh
deleted file mode 100644
index 796999549c36..000000000000
--- a/toolkit/workben/layout/refresh
+++ /dev/null
@@ -1,7 +0,0 @@
-echo "source me ..."
-test -n "${INPATH}" && rm -Rf ../../${INPATH}
-build debug=true\
- && cp ../../${INPATH}/lib/*.so ../../../solver/300/${INPATH}/lib \
- && cp -f ../..$INPATH/lib/libtkx.so $OOO_INSTALL_PREFIX/openoffice.org/basis3.0/program \
- && dmake debug=true \
- && ../../${INPATH}/bin/test "$@"
diff --git a/toolkit/workben/layout/run-s2x b/toolkit/workben/layout/run-s2x
deleted file mode 100644
index 926addf49047..000000000000
--- a/toolkit/workben/layout/run-s2x
+++ /dev/null
@@ -1,6 +0,0 @@
-#! /bin/sh
-
-SRC=${1-../../svx/source/dialog/zoom.src}
-SRC=${1-../../sw/source/ui/dialog/wordcountdialog.src}
-
-../src2xml/source/src2xml.py --ignore-includes --post-process --output-dir=. $SRC
diff --git a/toolkit/workben/layout/scroller.xml b/toolkit/workben/layout/scroller.xml
deleted file mode 100644
index 44e63d15df5e..000000000000
--- a/toolkit/workben/layout/scroller.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<dialog xmlns="http://openoffice.org/2007/layout"
- xmlns:cnt="http://openoffice.org/2007/layout/container"
- title="Scroll Test" optimumsize="true"
- has_border="true" sizeable="true" moveable="true">
- <vbox>
- <scroller>
- <vbox>
- <pushbutton label="Button 1" />
- <edit has_border="true" text="Edit 1" />
- <pushbutton label="Button 2" />
- <pushbutton label="Button 3" />
- <pushbutton label="Button 4" />
- <pushbutton label="Button 5" />
- <pushbutton label="Button 6" />
- <pushbutton label="Button 7" />
- <pushbutton label="Button 8" />
- <pushbutton label="Button 9" />
- <pushbutton label="Button 10" />
- <pushbutton label="Button 11" />
- <pushbutton label="Button 12" />
- <pushbutton label="Button 13" />
- <pushbutton label="Button 14" />
- <pushbutton label="Button 15" />
- <pushbutton label="Button 16" />
- <pushbutton label="Button 17" />
- </vbox>
- </scroller>
- <okbutton cnt:expand="false" />
- </vbox>
-</dialog>
diff --git a/toolkit/workben/layout/sequence.xml b/toolkit/workben/layout/sequence.xml
deleted file mode 100644
index e89db54db2dc..000000000000
--- a/toolkit/workben/layout/sequence.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<framewindow xmlns="http://openoffice.org/2007/layout"
- xmlns:cnt="http://openoffice.org/2007/layout/container"
- xmlns:style="http://openoffice.org/2007/layout/style"
- title="Sequence Test" style:optimumsize="true"
- style:has_border="true" style:sizeable="true" style:moveable="true">
- <vbox>
- <multilistbox linecount="5" string-item-list=":a:b::c:::d::::e:as:"
- selected-items="0:1" />
- <okbutton cnt:expand="false" />
- </vbox>
-</framewindow>
diff --git a/toolkit/workben/layout/shutdown.xml b/toolkit/workben/layout/shutdown.xml
deleted file mode 100644
index fbe49e046cb4..000000000000
--- a/toolkit/workben/layout/shutdown.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<modaldialog xmlns="http://openoffice.org/2007/layout"
- xmlns:cnt="http://openoffice.org/2007/layout/container"
- id="dialog" title="Shutdown Dialog" optimumsize="true"
- has_border="true" sizeable="true" moveable="true">
- <vbox border="5" spacing="5">
- <fixedline text="Platform default"/>
- <dialogbuttonhbox border="5" spacing="5">
- <flow/>
- <okbutton label="~Shutdown"/>
- <cancelbutton/>
- <pushbutton label="Pause"/>
- <pushbutton label="Sleep"/>
- <pushbutton label="Restart"/>
- </dialogbuttonhbox>
- <fixedline text="GNOME"/>
- <dialogbuttonhbox border="5" spacing="5" ordering="gnome">
- <flow/>
- <okbutton label="~Shutdown"/>
- <cancelbutton/>
- <pushbutton label="Pause"/>
- <pushbutton label="Sleep"/>
- <pushbutton label="Restart"/>
- </dialogbuttonhbox>
- <fixedline text="KDE"/>
- <dialogbuttonhbox border="5" spacing="5" ordering="kde">
- <flow/>
- <okbutton label="~Shutdown"/>
- <cancelbutton/>
- <pushbutton label="Pause"/>
- <pushbutton label="Sleep"/>
- <pushbutton label="Restart"/>
- </dialogbuttonhbox>
- <fixedline text="MacOS"/>
- <dialogbuttonhbox border="5" spacing="5" ordering="macos">
- <flow/>
- <okbutton label="~Shutdown"/>
- <cancelbutton/>
- <pushbutton label="Pause"/>
- <pushbutton label="Sleep"/>
- <pushbutton label="Restart"/>
- </dialogbuttonhbox>
- <fixedline text="Windows"/>
- <dialogbuttonhbox border="5" spacing="5" ordering="windowsg">
- <flow/>
- <okbutton label="~Shutdown"/>
- <cancelbutton/>
- <pushbutton label="Pause"/>
- <pushbutton label="Sleep"/>
- <pushbutton label="Restart"/>
- </dialogbuttonhbox>
- </vbox>
-</modaldialog>
diff --git a/toolkit/workben/layout/simple-paragraph.cxx b/toolkit/workben/layout/simple-paragraph.cxx
deleted file mode 100644
index 4cd204d107f7..000000000000
--- a/toolkit/workben/layout/simple-paragraph.cxx
+++ /dev/null
@@ -1,183 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-#include <toolkit/awt/vclxwindow.hxx>
-
-// include ---------------------------------------------------------------
-
-#include <cstdio>
-#include <tools/shl.hxx>
-#include <sfx2/objsh.hxx>
-#include <vcl/msgbox.hxx>
-
-#include <cstdio>
-
-namespace SVX {
-#include <svx/paraprev.hxx> // Preview
-};
-
-#include "simple-paragraph.hxx"
-
-#include <assert.h>
-
-
-
-
-
-// StandardTabPage ----------------------------------------------------------
-
-#define FT_LEFTINDENT 10
-#define ED_LEFTINDENT 11
-#define FT_FLINEINDENT 12
-#define ED_FLINEINDENT 13
-#define FT_RIGHTINDENT 14
-#define ED_RIGHTINDENT 15
-#define FL_INDENT 16
-
-#define FT_TOPDIST 20
-#define ED_TOPDIST 21
-#define FT_BOTTOMDIST 22
-#define ED_BOTTOMDIST 23
-#define FL_DIST 24
-
-#define BTN_LEFTALIGN 30
-#define BTN_RIGHTALIGN 31
-#define BTN_CENTERALIGN 32
-#define BTN_JUSTIFYALIGN 33
-#define FL_ALIGN 34
-#define FL_VERTALIGN 35
-#define LB_VERTALIGN 36
-#define FL_VERTEX 37
-#define CB_SNAP 38
-#define FT_VERTALIGN 39
-
-
-#define LB_LINEDIST 40
-#define FT_LINEDIST 41
-#define ED_LINEDISTPERCENT 42
-#define ED_LINEDISTMETRIC 43
-#define FL_LINEDIST 44
-#define WN_EXAMPLE 46
-
-#define CB_AUTO 48
-#define FT_LASTLINE 49
-#define LB_LASTLINE 50
-#define CB_EXPAND 51
-#define ST_LINEDIST_ABS 52
-#define ST_LEFTALIGN_ASIAN 53
-#define ST_RIGHTALIGN_ASIAN 54
-
-// ExtendedTabPage ----------------------------------------------------------
-
-#define BTN_HYPHEN 50
-#define ED_HYPHENBEFORE 52
-#define FT_HYPHENBEFORE 53
-#define ED_HYPHENAFTER 55
-#define FT_HYPHENAFTER 56
-#define FL_HYPHEN 57
-
-#define BTN_PAGEBREAK 60
-#define FT_BREAKTYPE 61
-#define LB_BREAKTYPE 62
-#define FT_BREAKPOSITION 63
-#define LB_BREAKPOSITION 64
-#define BTN_PAGECOLL 65
-#define LB_PAGECOLL 66
-#define BTN_KEEPTOGETHER 67
-#define BTN_WIDOWS 68
-#define ED_WIDOWS 69
-#define FT_WIDOWS 70
-#define BTN_ORPHANS 71
-#define ED_ORPHANS 72
-#define FT_ORPHANS 73
-#define FL_OPTIONS 74
-#define FT_PAGENUM 75
-#define ED_PAGENUM 76
-#define FL_BREAKS 77
-
-#define CB_KEEPTOGETHER 80
-#define FT_MAXHYPH 81
-#define ED_MAXHYPH 83
-
-#define CB_REGISTER 84
-#define FL_REGISTER 85
-#define FL_PROPERTIES 90
-#define FT_TEXTDIRECTION 91
-#define LB_TEXTDIRECTION 92
-
-
-//asian typography
-#define FL_AS_OPTIONS 1
-#define CB_AS_HANG_PUNC 2
-#define CB_AS_ALLOW_WORD_BREAK 3
-#define CB_AS_FORBIDDEN 4
-#define FL_AS_CHAR_DIST 5
-#define CB_AS_PUNCTUATION 6
-#define CB_AS_SCRIPT_SPACE 7
-#define CB_AS_ADJUST_NUMBERS 8
-
-
-
-
-
-
-
-
-SvxSimpleParagraphDialog::SvxSimpleParagraphDialog( Window* pParent )
- : SfxTabPage( pParent, SVX_RES( RID_SVXPAGE_STD_PARAGRAPH ), rAttr )
- , Dialog( pParent, "simple-paragraph.xml", "dialog" )
- , aLineSpacingList( this, "line-spacing-list" )
- , pPrevWin(NULL)
-{
-fprintf(stderr, "creating res mgr\n");
- pMgr = ResMgr::CreateResMgr("SOME_NAME");
-fprintf(stderr, "getting parent\n");
- VCLXWindow *pCompParent = VCLXWindow::GetImplementation( GetPeer() );
- assert( pCompParent != NULL );
- assert( pCompParent->GetWindow() != NULL );
-fprintf(stderr, "creating foreign vcl widget\n");
-/* pPrevWin = new SVX::SvxParaPrevWindow(
- pCompParent->GetWindow(),
- ResId(1234, *pMgr)
- );*/
-
-fprintf(stderr, "done\n");
- FreeResource();
-}
-
-// -----------------------------------------------------------------------
-
-SvxSimpleParagraphDialog::~SvxSimpleParagraphDialog()
-{
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/workben/layout/simple-paragraph.hxx b/toolkit/workben/layout/simple-paragraph.hxx
deleted file mode 100644
index d4feff479135..000000000000
--- a/toolkit/workben/layout/simple-paragraph.hxx
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SVX_SIMPLE_PARAGRAPH_HXX
-#define _SVX_SIMPLE_PARAGRAPH_HXX
-
-#include <layout/layout.hxx>
-
-#include <svx/paraprev.hxx> // Preview
-
-namespace SVX {
- class SvxParaPrevWindow;
-};
-class ResMgr;
-
-class SvxSimpleParagraphDialog : public SfxTabPage, public layout::Dialog
-{
-private:
- ListBox aLineSpacingList;
- SVX::SvxParaPrevWindow *pPrevWin;
- ResMgr *pMgr;
-
-public:
- SvxSimpleParagraphDialog( Window* pParent );
- ~SvxSimpleParagraphDialog();
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/workben/layout/simple-paragraph.xml b/toolkit/workben/layout/simple-paragraph.xml
deleted file mode 100644
index e07909dc8a39..000000000000
--- a/toolkit/workben/layout/simple-paragraph.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<dialog xmlns="http://openoffice.org/2007/layout"
- xmlns:cnt="http://openoffice.org/2007/layout/container"
- id="dialog" title="Paragraph test" optimumsize="true"
- has_border="true" sizeable="true" moveable="true">
- <vbox>
- <listbox id="line-spacing-list" dropdown="true" cnt:expand="false"
- string-item-list="Single:1.5 lines:Double:Proportional" />
- </vbox>
-</dialog>
diff --git a/toolkit/workben/layout/sort-options.xml b/toolkit/workben/layout/sort-options.xml
deleted file mode 100644
index a409ac2d530a..000000000000
--- a/toolkit/workben/layout/sort-options.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- This is a template. i18n translation is not performed in-place;
- i18n translated XML files are generated from this template by
- transex3/layout/tralay. !-->
-
-<tabpage help-id="HID_SCPAGE_SORT_OPTIONS"
- id="RID_SCPAGE_SORT_OPTIONS"
- sv-look="true" xmlns="http://openoffice.org/2007/layout" xmlns:cnt="http://openoffice.org/2007/layout/container"
- optimumsize="true"
- sizeable="true" moveable="true">
- <vbox spacing="4" border="5">
- <string id="STR_COL_LABEL" _text="Range contains column la~bels"/>
- <string id="STR_ROW_LABEL" _text="Range contains ~row labels"/>
- <string id="SCSTR_UNDEFINED" _text="- undefined -"/>
- <vbox spacing="4" border="5">
- <checkbox id="BTN_CASESENSITIVE" tabstop="true" _label="Case ~sensitive"/>
- <checkbox id="BTN_LABEL" tabstop="true"/>
- <checkbox id="BTN_FORMATS" tabstop="true" _label="Include ~formats"/>
- <checkbox id="BTN_NATURALSORT" tabstop="true" _label="Enable ~natural sort"/>
- <checkbox id="BTN_COPYRESULT" tabstop="true" _label="~Copy sort results to:"/>
- <hbox>
- <listbox has_border="true" dropdown="true" id="LB_OUTAREA" tabstop="true"/>
- <edit has_border="true" disable="true" id="ED_OUTAREA" tabstop="true"/>
- </hbox>
- <checkbox id="BTN_SORT_USER" tabstop="true" _label="Custom sort ~order"/>
- <listbox has_border="true" disable="true" dropdown="true" id="LB_SORT_USER" tabstop="true"/>
- <hbox>
- <fixedtext id="FT_LANGUAGE" _label="~Language"/>
- <fixedtext id="FT_ALGORITHM" _label="O~ptions"/>
- </hbox>
- <hbox>
- <svxlanguagebox has_border="true" dropdown="true" id="LB_LANGUAGE" sort="true" tabstop="true" _string-item-list="Default"/>
- <listbox has_border="true" dropdown="true" id="LB_ALGORITHM" tabstop="true"/>
- </hbox>
- <fixedline id="FL_DIRECTION" _text="Direction"/>
- <radiobutton id="BTN_TOP_DOWN" radiogroup="sort-options" tabstop="true" _label="~Top to bottom (sort rows)"/>
- <radiobutton id="BTN_LEFT_RIGHT" radiogroup="sort-options" tabstop="true" _label="L~eft to right (sort columns)"/>
- </vbox>
- </vbox>
-</tabpage>
diff --git a/toolkit/workben/layout/sortdlg.cxx b/toolkit/workben/layout/sortdlg.cxx
deleted file mode 100644
index ecc18da4fbc8..000000000000
--- a/toolkit/workben/layout/sortdlg.cxx
+++ /dev/null
@@ -1,72 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#if !TEST_LAYOUT
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sc.hxx"
-#endif /*! TEST_LAYOUT */
-
-#undef SC_DLLIMPLEMENTATION
-
-
-
-#include "tpsort.hxx"
-#include "sortdlg.hxx"
-#include "scresid.hxx"
-#include "sortdlg.hrc"
-
-#if !LAYOUT_SFX_TABDIALOG_BROKEN
-#include <layout/layout-pre.hxx>
-#endif
-
-ScSortDlg::ScSortDlg( Window* pParent,
- const SfxItemSet* pArgSet ) :
- SfxTabDialog( pParent,
- ScResId( RID_SCDLG_SORT ),
- pArgSet ),
- bIsHeaders ( FALSE ),
- bIsByRows ( FALSE )
-
-{
-#if LAYOUT_SFX_TABDIALOG_BROKEN
- AddTabPage( TP_FIELDS, ScTabPageSortFields::Create, 0 );
- AddTabPage( TP_OPTIONS, ScTabPageSortOptions::Create, 0 );
-#else /* !LAYOUT_SFX_TABDIALOG_BROKEN */
- String fields(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM ("fields")));
- AddTabPage( TP_FIELDS, fields, ScTabPageSortFields::Create, 0, FALSE, TAB_APPEND);
- String options(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM ("options")));
- AddTabPage( TP_OPTIONS, options, ScTabPageSortOptions::Create, 0, FALSE, TAB_APPEND);
-#endif /* !LAYOUT_SFX_TABDIALOG_BROKEN */
- FreeResource();
-}
-
-ScSortDlg::~ScSortDlg()
-{
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/workben/layout/sortdlg.hrc b/toolkit/workben/layout/sortdlg.hrc
deleted file mode 100644
index 1b62f3f8cbac..000000000000
--- a/toolkit/workben/layout/sortdlg.hrc
+++ /dev/null
@@ -1,71 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-
-#include "sc.hrc" // -> RID_SCDLG_SORT
- // -> RID_SCPAGE_SORT_FIELDS
- // -> RID_SCPAGE_SORT_OPTIONS
- // -> SCSTR_NONAME
- // -> SCSTR_UNDEFINED
- // -> SCSTR_FIELD
-
-#define TP_FIELDS 1
-#define TP_OPTIONS 2
-
-// TP_SORT_FIELDS:
-#define FL_SORT1 1
-#define FL_SORT2 2
-#define FL_SORT3 3
-#define LB_SORT1 4
-#define LB_SORT2 5
-#define LB_SORT3 6
-#define BTN_UP1 7
-#define BTN_UP2 8
-#define BTN_UP3 9
-#define BTN_DOWN1 10
-#define BTN_DOWN2 11
-#define BTN_DOWN3 12
-
-// TP_SORT_OPTIONS:
-#define FL_DIRECTION 1
-#define LB_SORT_USER 2
-#define LB_OUTAREA 3
-#define ED_OUTAREA 4
-#define BTN_SORT_USER 7
-#define BTN_CASESENSITIVE 8
-#define BTN_LABEL 9
-#define BTN_FORMATS 10
-#define BTN_COPYRESULT 11
-#define BTN_TOP_DOWN 12
-#define BTN_LEFT_RIGHT 13
-#define STR_COL_LABEL 14
-#define STR_ROW_LABEL 15
-#define FT_LANGUAGE 16
-#define LB_LANGUAGE 17
-#define FT_ALGORITHM 18
-#define LB_ALGORITHM 19
-#define BTN_NATURALSORT 20
diff --git a/toolkit/workben/layout/sortdlg.hxx b/toolkit/workben/layout/sortdlg.hxx
deleted file mode 100644
index c63f24989aca..000000000000
--- a/toolkit/workben/layout/sortdlg.hxx
+++ /dev/null
@@ -1,76 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef SC_SORTDLG_HXX
-#define SC_SORTDLG_HXX
-
-#include <sfx2/tabdlg.hxx>
-
-#if TEST_LAYOUT
-#define LAYOUT_SFX_TABDIALOG_BROKEN 0
-#else /* !TEST_LAYOUT */
-#ifndef LAYOUT_SFX_TABDIALOG_BROKEN
-#define LAYOUT_SFX_TABDIALOG_BROKEN 1
-#endif /* !LAYOUT_SFX_TABDIALOG_BROKEN */
-#endif /* !TEST_LAYOUT */
-
-#if !LAYOUT_SFX_TABDIALOG_BROKEN
-#include <sfx2/layout.hxx>
-#include <layout/layout-pre.hxx>
-#endif
-
-class ScSortDlg : public SfxTabDialog
-{
-public:
- ScSortDlg( Window* pParent,
- const SfxItemSet* pArgSet );
- ~ScSortDlg();
-
- void SetHeaders( BOOL bHeaders );
- void SetByRows ( BOOL bByRows );
- BOOL GetHeaders() const;
- BOOL GetByRows () const;
-
-
-private:
- BOOL bIsHeaders;
- BOOL bIsByRows;
-};
-
-inline void ScSortDlg::SetHeaders( BOOL bHeaders ) { bIsHeaders = bHeaders; }
-inline void ScSortDlg::SetByRows ( BOOL bByRows ) { bIsByRows = bByRows; }
-inline BOOL ScSortDlg::GetHeaders() const { return bIsHeaders; }
-inline BOOL ScSortDlg::GetByRows () const { return bIsByRows; }
-
-#if !LAYOUT_SFX_TABDIALOG_BROKEN
-#include <layout/layout-post.hxx>
-#endif
-
-#endif // SC_SORTDLG_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/workben/layout/sortdlg.src b/toolkit/workben/layout/sortdlg.src
deleted file mode 100644
index f52758f61785..000000000000
--- a/toolkit/workben/layout/sortdlg.src
+++ /dev/null
@@ -1,331 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#include "sortdlg.hrc"
-TabPage RID_SCPAGE_SORT_FIELDS
-{
- Hide = TRUE ;
- SVLook = TRUE ;
- HelpId = HID_SCPAGE_SORT_FIELDS ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- ListBox LB_SORT1
- {
- HelpID = "toolkit:ListBox:RID_SCPAGE_SORT_FIELDS:LB_SORT1";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 19 ) ;
- Size = MAP_APPFONT ( 154 , 90 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- };
- RadioButton BTN_UP1
- {
- HelpID = "toolkit:RadioButton:RID_SCPAGE_SORT_FIELDS:BTN_UP1";
- Pos = MAP_APPFONT ( 172 , 14 ) ;
- Size = MAP_APPFONT ( 79 , 10 ) ;
- Text [ en-US ] = "~Ascending" ;
- TabStop = TRUE ;
- };
- RadioButton BTN_DOWN1
- {
- HelpID = "toolkit:RadioButton:RID_SCPAGE_SORT_FIELDS:BTN_DOWN1";
- Pos = MAP_APPFONT ( 172 , 28 ) ;
- Size = MAP_APPFONT ( 79 , 10 ) ;
- Text [ en-US ] = "~Descending" ;
- TabStop = TRUE ;
- };
- FixedLine FL_SORT1
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Sort ~by" ;
- };
- ListBox LB_SORT2
- {
- HelpID = "toolkit:ListBox:RID_SCPAGE_SORT_FIELDS:LB_SORT2";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 60 ) ;
- Size = MAP_APPFONT ( 154 , 90 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- };
- RadioButton BTN_UP2
- {
- HelpID = "toolkit:RadioButton:RID_SCPAGE_SORT_FIELDS:BTN_UP2";
- Pos = MAP_APPFONT ( 172 , 55 ) ;
- Size = MAP_APPFONT ( 79 , 10 ) ;
- Text [ en-US ] = "A~scending" ;
- TabStop = TRUE ;
- };
- RadioButton BTN_DOWN2
- {
- HelpID = "toolkit:RadioButton:RID_SCPAGE_SORT_FIELDS:BTN_DOWN2";
- Pos = MAP_APPFONT ( 172 , 69 ) ;
- Size = MAP_APPFONT ( 79 , 10 ) ;
- Text [ en-US ] = "D~escending" ;
- TabStop = TRUE ;
- };
- FixedLine FL_SORT2
- {
- Pos = MAP_APPFONT ( 6 , 44 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Then b~y" ;
- };
- ListBox LB_SORT3
- {
- HelpID = "toolkit:ListBox:RID_SCPAGE_SORT_FIELDS:LB_SORT3";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 101 ) ;
- Size = MAP_APPFONT ( 154 , 90 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- };
- RadioButton BTN_UP3
- {
- HelpID = "toolkit:RadioButton:RID_SCPAGE_SORT_FIELDS:BTN_UP3";
- Pos = MAP_APPFONT ( 172 , 96 ) ;
- Size = MAP_APPFONT ( 79 , 10 ) ;
- Text [ en-US ] = "As~cending" ;
- TabStop = TRUE ;
- };
- RadioButton BTN_DOWN3
- {
- HelpID = "toolkit:RadioButton:RID_SCPAGE_SORT_FIELDS:BTN_DOWN3";
- Pos = MAP_APPFONT ( 172 , 110 ) ;
- Size = MAP_APPFONT ( 79 , 10 ) ;
- Text [ en-US ] = "Desce~nding" ;
- TabStop = TRUE ;
- };
- FixedLine FL_SORT3
- {
- Pos = MAP_APPFONT ( 6 , 85 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "T~hen by" ;
- };
-};
-
-TabPage RID_SCPAGE_SORT_OPTIONS
-{
- Hide = TRUE ;
- SVLook = TRUE ;
- HelpId = HID_SCPAGE_SORT_OPTIONS ;
- Pos = MAP_APPFONT ( 0 , 0 ) ;
- Size = MAP_APPFONT ( 260 , 185 ) ;
- CheckBox BTN_CASESENSITIVE
- {
- HelpID = "toolkit:CheckBox:RID_SCPAGE_SORT_OPTIONS:BTN_CASESENSITIVE";
- Pos = MAP_APPFONT ( 12 , 6 ) ;
- Size = MAP_APPFONT ( 242 , 10 ) ;
- Text [ en-US ] = "Case ~sensitive" ;
- TabStop = TRUE ;
- };
- CheckBox BTN_LABEL
- {
- HelpID = "toolkit:CheckBox:RID_SCPAGE_SORT_OPTIONS:BTN_LABEL";
- Pos = MAP_APPFONT ( 12 , 20 ) ;
- Size = MAP_APPFONT ( 242 , 10 ) ;
- TabStop = TRUE ;
- };
- String STR_COL_LABEL
- {
- Text [ en-US ] = "Range contains column la~bels" ;
- };
- String STR_ROW_LABEL
- {
- Text [ en-US ] = "Range contains ~row labels" ;
- };
- CheckBox BTN_FORMATS
- {
- HelpID = "toolkit:CheckBox:RID_SCPAGE_SORT_OPTIONS:BTN_FORMATS";
- Pos = MAP_APPFONT ( 12 , 34 ) ;
- Size = MAP_APPFONT ( 242 , 10 ) ;
- Text [ en-US ] = "Include ~formats" ;
- TabStop = TRUE ;
- };
- CheckBox BTN_NATURALSORT
- {
- HelpID = "toolkit:CheckBox:RID_SCPAGE_SORT_OPTIONS:BTN_NATURALSORT";
- Pos = MAP_APPFONT ( 12 , 48 ) ;
- Size = MAP_APPFONT ( 242 , 10 ) ;
- Text [ de ] = "Enable ~natural sort" ;
- Text [ en-US ] = "Enable ~natural sort" ;
- Text [ cs ] = "Aktivovat přirozené třídění" ;
- Text [ sk ] = "Aktivovať prirodzené triedenie" ;
- TabStop = TRUE ;
- Text [ x-comment ] = " " ;
- };
- CheckBox BTN_COPYRESULT
- {
- HelpID = "toolkit:CheckBox:RID_SCPAGE_SORT_OPTIONS:BTN_COPYRESULT";
- Pos = MAP_APPFONT ( 12 , 62 ) ;
- Size = MAP_APPFONT ( 242 , 10 ) ;
- Text [ en-US ] = "~Copy sort results to:" ;
- TabStop = TRUE ;
- };
- ListBox LB_OUTAREA
- {
- HelpID = "toolkit:ListBox:RID_SCPAGE_SORT_OPTIONS:LB_OUTAREA";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 20 , 73 ) ;
- Size = MAP_APPFONT ( 93 , 90 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- };
- Edit ED_OUTAREA
- {
- HelpID = "toolkit:Edit:RID_SCPAGE_SORT_OPTIONS:ED_OUTAREA";
- Disable = TRUE ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 119 , 73 ) ;
- Size = MAP_APPFONT ( 132 , 12 ) ;
- TabStop = TRUE ;
- };
- CheckBox BTN_SORT_USER
- {
- HelpID = "toolkit:CheckBox:RID_SCPAGE_SORT_OPTIONS:BTN_SORT_USER";
- Pos = MAP_APPFONT ( 12 , 89 ) ;
- Size = MAP_APPFONT ( 242 , 10 ) ;
- Text [ en-US ] = "Custom sort ~order" ;
- TabStop = TRUE ;
- };
- ListBox LB_SORT_USER
- {
- HelpID = "toolkit:ListBox:RID_SCPAGE_SORT_OPTIONS:LB_SORT_USER";
- Disable = TRUE ;
- Border = TRUE ;
- Pos = MAP_APPFONT ( 20 , 100 ) ;
- Size = MAP_APPFONT ( 231 , 90 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- };
- FixedText FT_LANGUAGE
- {
- Pos = MAP_APPFONT ( 12 , 118 ) ;
- Size = MAP_APPFONT ( 101 , 8 ) ;
- Text [ en-US ] = "~Language";
- };
- ListBox LB_LANGUAGE
- {
- HelpID = "toolkit:ListBox:RID_SCPAGE_SORT_OPTIONS:LB_LANGUAGE";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 129 ) ;
- Size = MAP_APPFONT ( 101 , 90 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- Sort = TRUE ;
- };
- FixedText FT_ALGORITHM
- {
- Pos = MAP_APPFONT ( 119 , 118 ) ;
- Size = MAP_APPFONT ( 132 , 8 ) ;
- Text [ en-US ] = "O~ptions";
- };
- ListBox LB_ALGORITHM
- {
- HelpID = "toolkit:ListBox:RID_SCPAGE_SORT_OPTIONS:LB_ALGORITHM";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 119 , 129 ) ;
- Size = MAP_APPFONT ( 132 , 90 ) ;
- TabStop = TRUE ;
- DropDown = TRUE ;
- };
- FixedLine FL_DIRECTION
- {
- Pos = MAP_APPFONT ( 6 , 147 ) ;
- Size = MAP_APPFONT ( 248 , 8 ) ;
- Text [ en-US ] = "Direction" ;
- };
- RadioButton BTN_TOP_DOWN
- {
- HelpID = "toolkit:RadioButton:RID_SCPAGE_SORT_OPTIONS:BTN_TOP_DOWN";
- Pos = MAP_APPFONT ( 12 , 158 ) ;
- Size = MAP_APPFONT ( 242 , 10 ) ;
- Text [ en-US ] = "~Top to bottom (sort rows)" ;
- TabStop = TRUE ;
- };
- RadioButton BTN_LEFT_RIGHT
- {
- HelpID = "toolkit:RadioButton:RID_SCPAGE_SORT_OPTIONS:BTN_LEFT_RIGHT";
- Pos = MAP_APPFONT ( 12 , 172 ) ;
- Size = MAP_APPFONT ( 242 , 10 ) ;
- Text [ en-US ] = "L~eft to right (sort columns)" ;
- TabStop = TRUE ;
- };
-};
-
-TabDialog RID_SCDLG_SORT
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 220 , 175 ) ;
- Text [ en-US ] = "Sort" ;
- Moveable = TRUE ;
- Closeable = FALSE ;
- TabControl 1
- {
- OutputSize = TRUE ;
- Pos = MAP_APPFONT ( 0 , 0 ) ;
- Size = MAP_APPFONT ( 210 , 170 ) ;
- PageList =
- {
- PageItem
- {
- Identifier = TP_FIELDS ;
- PageResID = TP_FIELDS ;
- Text [ en-US ] = "Sort Criteria" ;
- };
- PageItem
- {
- Identifier = TP_OPTIONS ;
- PageResID = TP_OPTIONS ;
- Text [ en-US ] = "Options" ;
- };
- };
- };
- OKButton 1
- {
- Pos = MAP_APPFONT ( 3 , 157 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- TabStop = TRUE ;
- };
- CancelButton 1
- {
- Pos = MAP_APPFONT ( 49 , 157 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- TabStop = TRUE ;
- };
- PushButton 1
- {
- Pos = MAP_APPFONT ( 137 , 157 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- TabStop = TRUE ;
- };
- HelpButton 1
- {
- Pos = MAP_APPFONT ( 94 , 157 ) ;
- Size = MAP_APPFONT ( 40 , 12 ) ;
- TabStop = TRUE ;
- };
-};
diff --git a/toolkit/workben/layout/sortdlg.xml b/toolkit/workben/layout/sortdlg.xml
deleted file mode 100644
index ce45a60ff1ee..000000000000
--- a/toolkit/workben/layout/sortdlg.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- This is a template. i18n translation is not performed in-place;
- i18n translated XML files are generated from this template by
- transex3/layout/tralay. !-->
-
-<tabpage help-id="HID_SCPAGE_SORT_FIELDS" hide="true" id="RID_SCPAGE_SORT_FIELDS" sv-look="true" xmlns="http://openoffice.org/2007/layout" xmlns:cnt="http://openoffice.org/2007/layout/container">
- <vbox>
- <fixedline id="FL_SORT1" text="Sort ~by"/>
- <radiobutton id="BTN_UP1" tabstop="true" label="~Ascending"/>
- <listbox has_border="true" dropdown="true" id="LB_SORT1" tabstop="true"/>
- <radiobutton id="BTN_DOWN1" tabstop="true" label="~Descending"/>
- <fixedline id="FL_SORT2" text="Then b~y"/>
- <radiobutton id="BTN_UP2" tabstop="true" label="A~scending"/>
- <listbox has_border="true" dropdown="true" id="LB_SORT2" tabstop="true"/>
- <radiobutton id="BTN_DOWN2" tabstop="true" label="D~escending"/>
- <fixedline id="FL_SORT3" text="T~hen by"/>
- <radiobutton id="BTN_UP3" tabstop="true" label="As~cending"/>
- <listbox has_border="true" dropdown="true" id="LB_SORT3" tabstop="true"/>
- <radiobutton id="BTN_DOWN3" tabstop="true" label="Desce~nding"/>
- </vbox>
-</tabpage>
-<tabpage help-id="HID_SCPAGE_SORT_OPTIONS" hide="true" id="RID_SCPAGE_SORT_OPTIONS" sv-look="true" xmlns="http://openoffice.org/2007/layout" xmlns:cnt="http://openoffice.org/2007/layout/container">
- <string id="STR_COL_LABEL" text="Range contains column la~bels"/>
- <string id="STR_ROW_LABEL" text="Range contains ~row labels"/>
- <vbox>
- <checkbox id="BTN_CASESENSITIVE" tabstop="true" label="Case ~sensitive"/>
- <checkbox id="BTN_LABEL" tabstop="true"/>
- <checkbox id="BTN_FORMATS" tabstop="true" label="Include ~formats"/>
- <checkbox id="BTN_NATURALSORT" tabstop="true" label=" "/>
- <checkbox id="BTN_COPYRESULT" tabstop="true" label="~Copy sort results to:"/>
- <hbox>
- <listbox has_border="true" dropdown="true" id="LB_OUTAREA" tabstop="true"/>
- <edit has_border="true" disable="true" id="ED_OUTAREA" tabstop="true"/>
- </hbox>
- <checkbox id="BTN_SORT_USER" tabstop="true" label="Custom sort ~order"/>
- <listbox has_border="true" disable="true" dropdown="true" id="LB_SORT_USER" tabstop="true"/>
- <hbox>
- <fixedtext id="FT_LANGUAGE" label="~Language"/>
- <fixedtext id="FT_ALGORITHM" label="O~ptions"/>
- </hbox>
- <hbox>
- <listbox has_border="true" dropdown="true" id="LB_LANGUAGE" sort="true" tabstop="true"/>
- <listbox has_border="true" dropdown="true" id="LB_ALGORITHM" tabstop="true"/>
- </hbox>
- <fixedline id="FL_DIRECTION" text="Direction"/>
- <radiobutton id="BTN_TOP_DOWN" tabstop="true" label="~Top to bottom (sort rows)"/>
- <radiobutton id="BTN_LEFT_RIGHT" tabstop="true" label="L~eft to right (sort columns)"/>
- </vbox>
-</tabpage>
-<tabdialog closeable="false" moveable="true" output-size="true" id="RID_SCDLG_SORT" sv-look="true" text="Sort" xmlns="http://openoffice.org/2007/layout" xmlns:cnt="http://openoffice.org/2007/layout/container">
- <vbox>
- <tabcontrol output-size="true" id="1">
- <pagelist>
- <pageitem identifier="TP_FIELDS" page-res-id="TP_FIELDS" text="Sort Criteria"/>
- <pageitem identifier="TP_OPTIONS" page-res-id="TP_OPTIONS" text="Options"/>
- </pagelist>
- </tabcontrol>
- <hbox>
- <okbutton defbutton="true" id="1" tabstop="true"/>
- <cancelbutton id="1" tabstop="true"/>
- <helpbutton id="1" tabstop="true"/>
- <pushbutton id="1" tabstop="true"/>
- </hbox>
- </vbox>
-</tabdialog>
diff --git a/toolkit/workben/layout/splitter.xml b/toolkit/workben/layout/splitter.xml
deleted file mode 100644
index 634ad829b001..000000000000
--- a/toolkit/workben/layout/splitter.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<dialog xmlns="http://openoffice.org/2007/layout"
- xmlns:cnt="http://openoffice.org/2007/layout/container"
- title="Splitter Test" optimumsize="true" has_border="true" sizeable="true" moveable="true">
- <vbox>
- <hsplitter>
- <pushbutton label="Left" />
- <pushbutton label="Right" />
- </hsplitter>
- <okbutton cnt:expand="false" />
- </vbox>
-</dialog>
diff --git a/toolkit/workben/layout/string-input.xml b/toolkit/workben/layout/string-input.xml
deleted file mode 100644
index b1aed5197c17..000000000000
--- a/toolkit/workben/layout/string-input.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- This is a template. i18n translation is not performed in-place;
- i18n translated XML files are generated from this template by
- transex3/layout/tralay. !-->
-
-<modaldialog sizeable="true" closeable="false" moveable="true" output-size="true" id="RID_SCDLG_STRINPUT" sv-look="true" xmlns="http://openoffice.org/2007/layout" xmlns:cnt="http://openoffice.org/2007/layout/container" title="Insert String">
- <vbox spacing="5" border="5">
- <fixedtext id="FT_LABEL" label="FT-LABEL"/>
- <edit has_border="true" id="ED_INPUT" tabstop="true"/>
- <dialogbuttonhbox border="5" spacing="5">
- <okbutton defbutton="true" id="BTN_OK" tabstop="true"/>
- <cancelbutton id="BTN_CANCEL" tabstop="true"/>
- <helpbutton id="BTN_HELP" tabstop="true"/>
- </dialogbuttonhbox>
- </vbox>
-</modaldialog>
diff --git a/toolkit/workben/layout/tab-dialog.xml b/toolkit/workben/layout/tab-dialog.xml
deleted file mode 100644
index da75f03e9df5..000000000000
--- a/toolkit/workben/layout/tab-dialog.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<dialog xmlns="http://openoffice.org/2007/layout"
- xmlns:cnt="http://openoffice.org/2007/layout/container"
- _title="layout::TabDialog" optimumsize="true"
- id="tab-dialog"
- has_border="true" sizeable="true" moveable="true">
- <vbox spacing="5" border="5">
- <tabcontrol id="ID_TABCONTROL"/>
- <dialogbuttonhbox border="5" spacing="5" cnt:expand="false">
- <flow/>
- <okbutton defbutton="true" id="BTN_OK" show="false"/>
- <pushbutton id="BTN_USER" _label="&lt;User&gt;" show="false"/>
- <cancelbutton id="BTN_CANCEL" show="false"/>
- <helpbutton id="BTN_HELP" show="false"/>
- <resetbutton id="BTN_RESET" show="false"/>
- <pushbutton id="BTN_BASEFMT" _label="&lt;Base Format&gt;" show="false"/>
- </dialogbuttonhbox>
- </vbox>
-</dialog>
diff --git a/toolkit/workben/layout/tabcontrol.xml b/toolkit/workben/layout/tabcontrol.xml
deleted file mode 100644
index 2986f1f9e0d9..000000000000
--- a/toolkit/workben/layout/tabcontrol.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<dialog xmlns="http://openoffice.org/2007/layout"
- xmlns:cnt="http://openoffice.org/2007/layout/container"
- title="TabControl Test" optimumsize="true"
- has_border="true" sizeable="true" moveable="true">
- <vbox>
- <tabcontrol>
- <pushbutton label="Child 1" cnt:title="Page 1" />
- <edit has_border="true" text="Child 2" cnt:title="Page 2" />
- <vbox cnt:title="Page 3">
- <pushbutton label="Child 3"/>
- <edit has_border="true" text="Child 4" />
- </vbox>
- </tabcontrol>
- <okbutton cnt:expand="false" />
- </vbox>
-</dialog>
diff --git a/toolkit/workben/layout/table.xml b/toolkit/workben/layout/table.xml
deleted file mode 100644
index 673bd85ddab3..000000000000
--- a/toolkit/workben/layout/table.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<dialog xmlns="http://openoffice.org/2007/layout"
- xmlns:cnt="http://openoffice.org/2007/layout/container"
- title="Table Test" optimumsize="true"
- has_border="true" sizeable="true" moveable="true">
- <table columns="3">
- <!-- row 0 -->
- <pushbutton cnt:x-expand="false" cnt:row-span="2" label="1,1" />
- <pushbutton cnt:y-expand="false" label="1,2" />
- <pushbutton cnt:y-expand="false" label="1,3" />
- <!-- row 1 -->
- <pushbutton cnt:col-span="2" label="2,1" />
- </table>
-</dialog>
diff --git a/toolkit/workben/layout/test.cxx b/toolkit/workben/layout/test.cxx
deleted file mode 100644
index f90317a5ae37..000000000000
--- a/toolkit/workben/layout/test.cxx
+++ /dev/null
@@ -1,369 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <vcl/svapp.hxx>
-
-// This works and was used before for standalone test, not sure why
-// we'd want it.
-#define LAYOUT_WEAK 1
-#include "uno.hxx"
-
-#include <cstdio>
-#include <cstdlib>
-#include <sys/stat.h>
-
-#include <com/sun/star/xml/sax/SAXException.hpp>
-#include <comphelper/processfactory.hxx>
-#include <cppuhelper/bootstrap.hxx>
-#include <rtl/ustring.hxx>
-#include <ucbhelper/configurationkeys.hxx>
-#include <ucbhelper/contentbroker.hxx>
-
-#define SORT_DLG 1 /* requires sfx2, svx to be compiled */
-#if SORT_DLG
-#include "scitems.hxx"
-#include "uiitems.hxx"
-#endif /* SORT_DLG */
-
-#include "editor.hxx"
-
-#include "plugin.hxx"
-#undef _LAYOUT_POST_HXX
-
-#include "recover.hxx"
-#undef _LAYOUT_POST_HXX
-
-#if SORT_DLG
-#include "sortdlg.hxx"
-#undef _LAYOUT_POST_HXX
-#endif /* SORT_DLG */
-
-#include "wordcountdialog.hxx"
-#undef _LAYOUT_POST_HXX
-
-#include "zoom.hxx"
-#undef _LAYOUT_POST_HXX
-
-#include <layout/layout-pre.hxx>
-
-using namespace ::rtl;
-using namespace ::cppu;
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::uno;
-
-class LayoutTest : public Application
-{
- Reference< XComponentContext > mxContext;
- Reference< lang::XMultiServiceFactory > mxMSF;
- OUString mInstallDir;
- OUString mTestDialog;
- bool mEditMode;
- std::list< OUString > mFiles;
-
-public:
- LayoutTest( char const* installDir );
-
- void RunEditor();
- void RunFiles();
- void ExceptionalMain();
- void Init();
- void InitUCB();
- void LoadFile( OUString const &aName );
- void Main();
- void ParseCommandLine();
-};
-
-static void usage()
-{
- fprintf (stderr, "usage: test [--inst OOO_INSTALL_PREFIX] [DIALOG.XML]... | --test [DIALOG.XML]\n" );
- exit( 2 );
-}
-
-static uno::Reference< lang::XSingleServiceFactory > get_factory( char const *service )
-{
- uno::Reference< lang::XSingleServiceFactory > xFactory(
- comphelper::createProcessComponent(
- rtl::OUString::createFromAscii( service ) ), uno::UNO_QUERY );
-
- if ( !xFactory.is() )
- fprintf( stderr, "error loading: %s\n", service );
- return xFactory;
-}
-
-#define GET_FACTORY(x) get_factory( #x )
-
-void LayoutTest::LoadFile( const OUString &aTestFile )
-{
- fprintf( stderr, "TEST: layout instance\n" );
-
- uno::Reference< lang::XSingleServiceFactory > xFactory
- = GET_FACTORY( com.sun.star.awt.Layout );
- if ( !xFactory.is() )
- {
- fprintf( stderr, "Layout engine not installed\n" );
- throw uno::RuntimeException(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Layout engine not installed" ) ),
- uno::Reference< uno::XInterface >() );
- }
- fprintf( stderr, "TEST: initing root\n" );
-
- uno::Sequence< uno::Any > aParams( 1 );
- aParams[0] <<= aTestFile;
-
- uno::Reference< awt::XLayoutRoot > xRoot (
- xFactory->createInstanceWithArguments( aParams ),
- uno::UNO_QUERY );
-
- fprintf( stderr, "TEST: file loaded\n" );
-}
-
-void LayoutTest::InitUCB()
-{
- OUString aEmpty;
- Sequence< Any > aArgs( 6 );
- aArgs[0]
- <<= OUString(RTL_CONSTASCII_USTRINGPARAM( UCB_CONFIGURATION_KEY1_LOCAL ));
- aArgs[1]
- <<= OUString(RTL_CONSTASCII_USTRINGPARAM( UCB_CONFIGURATION_KEY2_OFFICE ));
- aArgs[2] <<= OUString(RTL_CONSTASCII_USTRINGPARAM("PIPE"));
- aArgs[3] <<= aEmpty;
- aArgs[4] <<= OUString(RTL_CONSTASCII_USTRINGPARAM("PORTAL"));
- aArgs[5] <<= aEmpty;
-
- if ( !::ucbhelper::ContentBroker::initialize( mxMSF, aArgs ) )
- {
- fprintf( stderr, "Failed to init content broker\n" );
- fprintf( stderr, "arg[0]: %s\n", UCB_CONFIGURATION_KEY1_LOCAL );
- fprintf( stderr, "arg[1]: %s\n", UCB_CONFIGURATION_KEY2_OFFICE );
- }
-}
-
-static void support_upstream_brand_prefix ()
-{
- if ( char const* inst = getenv( "OOO_INSTALL_PREFIX" ) )
- {
- char const *brand_prefix = "/openoffice.org3";
- OUString brand_dir = OUString::createFromAscii( inst )
- + OUString::createFromAscii( brand_prefix );
- struct stat stat_info;
- if ( !stat ( OUSTRING_CSTR( brand_dir ), &stat_info ) )
- {
- OSL_TRACE( "Appending %s to OOO_INSTALL_PREFIX", brand_prefix );
- setenv( "OOO_INSTALL_PREFIX", OUSTRING_CSTR( brand_dir ), 1 );
- }
- }
-}
-
-void LayoutTest::Init()
-{
- ParseCommandLine();
- setenv( "OOO_INSTALL_PREFIX", OUSTRING_CSTR( mInstallDir ), 0 );
- support_upstream_brand_prefix ();
- OSL_TRACE( "OOO_INSTALL_PREFIX=%s", getenv( "OOO_INSTALL_PREFIX" ) );
-
- mxContext = defaultBootstrap_InitialComponentContext();
- mxMSF = new UnoBootstrapLayout( Reference< lang::XMultiServiceFactory >( mxContext->getServiceManager(), UNO_QUERY ) );
- ::comphelper::setProcessServiceFactory( mxMSF );
- InitUCB();
-}
-
-void LayoutTest::ParseCommandLine()
-{
- printf ("%s\n", __PRETTY_FUNCTION__);
- for ( sal_uInt16 i = 0; i < GetCommandLineParamCount(); i++ )
- {
- OUString aParam = OUString( GetCommandLineParam( i ) );
- if ( aParam.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "-h" ) ) || aParam.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "--help" ) ) )
- usage();
- if ( aParam.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "--inst" ) ) )
- {
- if ( i >= GetCommandLineParamCount() - 1)
- usage();
- mInstallDir = GetCommandLineParam( ++i );
- setenv( "OOO_INSTALL_PREFIX", OUSTRING_CSTR( mInstallDir ), 1 );
- }
- else if ( aParam.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "--test" ) ) )
- {
- mTestDialog = OUString(RTL_CONSTASCII_USTRINGPARAM("zoom"));
- if (i + 1 < GetCommandLineParamCount())
- mTestDialog = GetCommandLineParam( ++i );
- }
- else if ( aParam.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "--editor" ) ) )
- mEditMode = true;
- else
- mFiles.push_back( aParam );
- }
-
- if ( mFiles.size() <= 0 )
- mFiles.push_back( OUString(RTL_CONSTASCII_USTRINGPARAM("layout.xml")) );
-}
-
-void LayoutTest::RunEditor()
-{
- OUString aFile;
- if ( !mFiles.empty()
- && mFiles.front().compareToAscii( "layout.xml" ) != 0 )
- aFile = mFiles.front();
- Editor editor( mxMSF, aFile );
- editor.Show();
- editor.Execute();
-}
-
-short RunDialog( Dialog& dialog )
-{
- dialog.Show();
- short result = dialog.Execute();
- fprintf( stderr, "Done: dialog execute exited:%d\n", result);
- return result;
-}
-
-#undef Dialog
-short RunDialog( ::Dialog& dialog )
-{
- dialog.Show();
- short result = dialog.Execute();
- fprintf( stderr, "Done: dialog execute exited:%d\n", result);
- return result;
-}
-
-#if SORT_DLG
-static void LoadSC()
-{
- get_factory( "com.sun.star.comp.sfx2.DocumentTemplates" );
- get_factory( "com.sun.star.comp.Calc.SpreadsheetDocument" );
- GET_FACTORY( com.sun.star.i18n.Transliteration.l10n );
-}
-#endif /* SORT_DLG */
-
-void TestDialog( OUString const& name )
-{
- if ( 0 )
- ;
- else if ( name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "plugin" ) ) )
- {
- PluginDialog plugin ( 0 );
- RunDialog( plugin );
- }
- else if ( name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "query" ) ) )
- {
- QueryBox query ( 0, "Do you want to do?", "do");
- RunDialog( query );
- }
- else if ( name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "query-compat" ) ) )
- {
- QueryBox query ( 0,
- WinBits( WB_YES_NO | WB_DEF_YES ),
-// WinBits( WB_ABORT_RETRY_IGNORE ),
- OUString(RTL_CONSTASCII_USTRINGPARAM ("Do you want to do?")));
- RunDialog( query );
- }
- else if ( name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "recover" ) ) )
- {
- SvxRecoverDialog recover ( 0 );
- RunDialog( recover );
- }
-#if SORT_DLG
- else if ( name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "sort" ) ) )
- {
- LoadSC();
- ScSortDlg sort (0, 0);
- RunDialog( sort );
- }
-#endif /* SORT_DLG */
- else if ( name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "wordcount" ) ) )
- {
- SwWordCountDialog words ( 0 );
- RunDialog( words );
- }
- else if ( name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "zoom" ) ) )
- {
- SvxZoomDialog zoom( 0 );
- RunDialog( zoom );
- }
-}
-
-void LayoutTest::RunFiles()
-{
- fprintf( stderr, "TEST: loading files\n" );
- for ( std::list< OUString >::iterator i = mFiles.begin(); i != mFiles.end(); ++i )
- LoadFile( *i );
- fprintf( stderr, "TEST: executing\n" );
- Execute();
- fprintf( stderr, "TEST: done executing\n" );
-}
-
-void LayoutTest::ExceptionalMain()
-{
- if ( mTestDialog.getLength() )
- TestDialog( mTestDialog );
- else if ( mEditMode )
- RunEditor();
- else
- RunFiles();
-}
-
-void LayoutTest::Main()
-{
- try
- {
- ExceptionalMain();
- }
- catch (xml::sax::SAXException & rExc)
- {
- OString aStr( OUStringToOString( rExc.Message,
- RTL_TEXTENCODING_ASCII_US ) );
- uno::Exception exc;
- if (rExc.WrappedException >>= exc)
- {
- aStr += OString( " >>> " );
- aStr += OUStringToOString( exc.Message, RTL_TEXTENCODING_ASCII_US );
- }
- fprintf (stderr, "Parsing error: '%s'\n", aStr.getStr());
- OSL_FAIL( aStr.getStr() );
- }
- catch ( uno::Exception & rExc )
- {
- OString aStr( OUStringToOString( rExc.Message,
- RTL_TEXTENCODING_ASCII_US ) );
- fprintf (stderr, "UNO error: '%s'\n", aStr.getStr());
- OSL_FAIL( aStr.getStr() );
- }
-
- Reference< lang::XComponent > xComp( mxContext, UNO_QUERY );
- if ( xComp.is() )
- xComp->dispose();
-}
-
-LayoutTest::LayoutTest( char const* installDir )
- : mInstallDir( OUString::createFromAscii ( installDir ) )
-{
-}
-
-LayoutTest layout_test( "/usr/local/lib/ooo" );
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/workben/layout/test.xml b/toolkit/workben/layout/test.xml
deleted file mode 100644
index d0b4f9062912..000000000000
--- a/toolkit/workben/layout/test.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<dialog xmlns="http://openoffice.org/2007/layout"
- xmlns:cnt="http://openoffice.org/2007/layout/container"
- title="Interactable Containers" optimumsize="true"
- has_border="true" sizeable="true" moveable="true">
- <tabcontrol>
- <tabpage cnt:title="Page">
- <pushbutton label="Test" />
- </tabpage>
- </tabcontrol>
-</dialog>
diff --git a/toolkit/workben/layout/testrc.in b/toolkit/workben/layout/testrc.in
deleted file mode 100644
index b6c232aae60f..000000000000
--- a/toolkit/workben/layout/testrc.in
+++ /dev/null
@@ -1,8 +0,0 @@
-OOO_INSTALL_PREFIX_URL=file://${OOO_INSTALL_PREFIX}
-OOO_BASIS_BIN_URL=${OOO_INSTALL_PREFIX_URL}/program
-OOO_URE_URL=${OOO_INSTALL_PREFIX_URL}/ure-link
-#
-BRAND_BASE_DIR=${OOO_INSTALL_PREFIX_URL}
-#
-UNO_TYPES=${OOO_URE_URL}/share/misc/types.rdb ${OOO_BASIS_BIN_URL}/offapi.rdb
-UNO_SERVICES=${OOO_URE_URL}/share/misc/services.rdb ${OOO_BASIS_BIN_URL}/services.rdb
diff --git a/toolkit/workben/layout/tpsort.cxx b/toolkit/workben/layout/tpsort.cxx
deleted file mode 100644
index ff8526c890aa..000000000000
--- a/toolkit/workben/layout/tpsort.cxx
+++ /dev/null
@@ -1,1107 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#if !TEST_LAYOUT
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sc.hxx"
-#endif /* !TEST_LAYOUT */
-
-#undef SC_DLLIMPLEMENTATION
-
-
-
-#include <vcl/msgbox.hxx>
-#include <i18npool/mslangid.hxx>
-#include <svtools/collatorres.hxx>
-#include <unotools/collatorwrapper.hxx>
-#include <unotools/localedatawrapper.hxx>
-#include <comphelper/processfactory.hxx>
-
-#include "scitems.hxx"
-#include "uiitems.hxx"
-#include "viewdata.hxx"
-#include "document.hxx"
-#include "global.hxx"
-#include "dbcolect.hxx"
-#include "userlist.hxx"
-#include "rangeutl.hxx"
-#include "scresid.hxx"
-#include "sc.hrc" // -> Slot IDs
-#include "globstr.hrc"
-
-#include "sortdlg.hxx"
-#include "sortdlg.hrc"
-
-#define _TPSORT_CXX
-#include "tpsort.hxx"
-#undef _TPSORT_CXX
-
-using namespace com::sun::star;
-
-// STATIC DATA -----------------------------------------------------------
-
-static USHORT pSortRanges[] =
-{
- SID_SORT,
- SID_SORT,
- 0
-};
-
-// -----------------------------------------------------------------------
-
-/*
- * Da sich Einstellungen auf der zweiten TabPage (Optionen) auf
- * die erste TabPage auswirken, muss es die Moeglichkeit geben,
- * dies der jeweils anderen Seite mitzuteilen.
- *
- * Im Moment wird dieses Problem ueber zwei Datenmember des TabDialoges
- * geloest. Wird eine Seite Aktiviert/Deaktiviert, so gleicht sie diese
- * Datenmember mit dem eigenen Zustand ab (->Activate()/Deactivate()).
- *
- * 31.01.95:
- * Die Klasse SfxTabPage bietet mittlerweile ein Verfahren an:
- *
- * virtual BOOL HasExchangeSupport() const; -> return TRUE;
- * virtual void ActivatePage(const SfxItemSet &);
- * virtual int DeactivatePage(SfxItemSet * = 0);
- *
- * muss noch geaendert werden!
- */
-
-//========================================================================
-//========================================================================
-// Sortierkriterien-Tabpage:
-
-ScTabPageSortFields::ScTabPageSortFields( Window* pParent,
- const SfxItemSet& rArgSet )
-
- : SfxTabPage ( pParent,
- ScResId( RID_SCPAGE_SORT_FIELDS ),
- rArgSet ),
- //
- aFlSort1 ( this, ScResId( FL_SORT1 ) ),
- aLbSort1 ( this, ScResId( LB_SORT1 ) ),
- aBtnUp1 ( this, ScResId( BTN_UP1 ) ),
- aBtnDown1 ( this, ScResId( BTN_DOWN1 ) ),
- //
- aFlSort2 ( this, ScResId( FL_SORT2 ) ),
- aLbSort2 ( this, ScResId( LB_SORT2 ) ),
- aBtnUp2 ( this, ScResId( BTN_UP2 ) ),
- aBtnDown2 ( this, ScResId( BTN_DOWN2 ) ),
- //
- aFlSort3 ( this, ScResId( FL_SORT3 ) ),
- aLbSort3 ( this, ScResId( LB_SORT3 ) ),
- aBtnUp3 ( this, ScResId( BTN_UP3 ) ),
- aBtnDown3 ( this, ScResId( BTN_DOWN3 ) ),
-
- aStrUndefined ( ScResId( SCSTR_UNDEFINED ) ),
- aStrColumn ( ScResId( SCSTR_COLUMN ) ),
- aStrRow ( ScResId( SCSTR_ROW ) ),
- //
-#if !TEST_LAYOUT
- nWhichSort ( rArgSet.GetPool()->GetWhich( SID_SORT ) ),
-#else /* TEST_LAYOUT */
- nWhichSort ( 0 ),
-#endif /* TEST_LAYOUT */
- pDlg ( (ScSortDlg*)(GetParent()->GetParent()) ),
- pViewData ( NULL ),
-#if !TEST_LAYOUT
- rSortData ( ((const ScSortItem&)
- rArgSet.Get( nWhichSort )).
- GetSortData() ),
-#else /* TEST_LAYOUT */
- rSortData ( *new ScSortParam() ),
-#endif /* TEST_LAYOUT */
- nFieldCount ( 0 ),
- bHasHeader ( FALSE ),
- bSortByRows ( FALSE )
-{
- Init();
- FreeResource();
- SetExchangeSupport();
-}
-
-// -----------------------------------------------------------------------
-
-ScTabPageSortFields::~ScTabPageSortFields()
-{
-}
-
-// -----------------------------------------------------------------------
-
-void ScTabPageSortFields::Init()
-{
-#if !TEST_LAYOUT
- const ScSortItem& rSortItem = (const ScSortItem&)
- GetItemSet().Get( nWhichSort );
-
- pViewData = rSortItem.GetViewData();
-
- DBG_ASSERT( pViewData, "ViewData not found!" );
-#endif /* !TEST_LAYOUT */
-
- nFieldArr[0] = 0;
- nFirstCol = 0;
- nFirstRow = 0;
-
- aLbSort1.SetSelectHdl( LINK( this, ScTabPageSortFields, SelectHdl ) );
- aLbSort2.SetSelectHdl( LINK( this, ScTabPageSortFields, SelectHdl ) );
- aLbSort3.SetSelectHdl( LINK( this, ScTabPageSortFields, SelectHdl ) );
- aLbSort1.Clear();
- aLbSort2.Clear();
- aLbSort3.Clear();
-
- aSortLbArr[0] = &aLbSort1;
- aSortLbArr[1] = &aLbSort2;
- aSortLbArr[2] = &aLbSort3;
- aDirBtnArr[0][0] = &aBtnUp1;
- aDirBtnArr[0][1] = &aBtnDown1;
- aDirBtnArr[1][0] = &aBtnUp2;
- aDirBtnArr[1][1] = &aBtnDown2;
- aDirBtnArr[2][0] = &aBtnUp3;
- aDirBtnArr[2][1] = &aBtnDown3;
- aFlArr[0] = &aFlSort1;
- aFlArr[1] = &aFlSort2;
- aFlArr[2] = &aFlSort3;
-}
-
-//------------------------------------------------------------------------
-
-USHORT* ScTabPageSortFields::GetRanges()
-{
- return pSortRanges;
-}
-
-// -----------------------------------------------------------------------
-
-SfxTabPage* ScTabPageSortFields::Create( Window* pParent,
- const SfxItemSet& rArgSet )
-{
- return ( new ScTabPageSortFields( pParent, rArgSet ) );
-}
-
-// -----------------------------------------------------------------------
-
-void ScTabPageSortFields::Reset( const SfxItemSet& /* rArgSet */ )
-{
- bSortByRows = rSortData.bByRow;
- bHasHeader = rSortData.bHasHeader;
-
- if ( aLbSort1.GetEntryCount() == 0 )
- FillFieldLists();
-
- // Selektieren der ListBoxen:
-
- if ( rSortData.bDoSort[0] )
- {
- for ( USHORT i=0; i<3; i++ )
- {
- if ( rSortData.bDoSort[i] )
- {
- aSortLbArr[i]->SelectEntryPos(
- GetFieldSelPos( rSortData.nField[i] ) );
-
- (rSortData.bAscending[i])
- ? aDirBtnArr[i][0]->Check() // Up
- : aDirBtnArr[i][1]->Check(); // Down
- }
- else
- {
- aSortLbArr[i]->SelectEntryPos( 0 ); // "keiner" selektieren
- aDirBtnArr[i][0]->Check(); // Up
- }
- }
-
- EnableField( 1 );
- EnableField( 2 );
- EnableField( 3 );
- if ( aLbSort1.GetSelectEntryPos() == 0 )
- DisableField( 2 );
- if ( aLbSort2.GetSelectEntryPos() == 0 )
- DisableField( 3 );
- }
- else
- {
- aLbSort1.SelectEntryPos( 1 );
- aLbSort2.SelectEntryPos( 0 );
- aLbSort3.SelectEntryPos( 0 );
- aBtnUp1.Check();
- aBtnUp2.Check();
- aBtnUp3.Check();
- EnableField ( 1 );
- EnableField ( 2 );
- DisableField( 3 );
- }
-
- if ( pDlg )
- {
- pDlg->SetByRows ( bSortByRows );
- pDlg->SetHeaders( bHasHeader );
- }
-}
-
-// -----------------------------------------------------------------------
-
-BOOL ScTabPageSortFields::FillItemSet( SfxItemSet& rArgSet )
-{
- ScSortParam theSortData = rSortData;
- if (pDlg)
- {
- const SfxItemSet* pExample = pDlg->GetExampleSet();
- const SfxPoolItem* pItem;
- if ( pExample && pExample->GetItemState( nWhichSort, TRUE, &pItem ) == SFX_ITEM_SET )
- theSortData = ((const ScSortItem*)pItem)->GetSortData();
- }
-
- USHORT nSort1Pos = aLbSort1.GetSelectEntryPos();
- USHORT nSort2Pos = aLbSort2.GetSelectEntryPos();
- USHORT nSort3Pos = aLbSort3.GetSelectEntryPos();
-
- DBG_ASSERT( (nSort1Pos <= SC_MAXFIELDS)
- && (nSort2Pos <= SC_MAXFIELDS)
- && (nSort3Pos <= SC_MAXFIELDS),
- "Array-Range Fehler!" );
-
- if ( nSort1Pos == LISTBOX_ENTRY_NOTFOUND ) nSort1Pos = 0;
- if ( nSort2Pos == LISTBOX_ENTRY_NOTFOUND ) nSort2Pos = 0;
- if ( nSort3Pos == LISTBOX_ENTRY_NOTFOUND ) nSort3Pos = 0;
-
- if ( nSort1Pos > 0 )
- {
- theSortData.bDoSort[0] = (nSort1Pos > 0);
- theSortData.bDoSort[1] = (nSort2Pos > 0);
- theSortData.bDoSort[2] = (nSort3Pos > 0);
-
- // wenn auf Optionen-Seite "OK" gewaehlt wurde und
- // dabei die Sortierrichtung umgestellt wurde, so
- // wird das erste Feld der jeweiligen Richtung als
- // Sortierkriterium gewaehlt (steht in nFieldArr[0]):
- if ( bSortByRows != pDlg->GetByRows() )
- {
- theSortData.nField[0] =
- theSortData.nField[1] =
- theSortData.nField[2] = ( bSortByRows ?
- static_cast<SCCOLROW>(nFirstRow) :
- static_cast<SCCOLROW>(nFirstCol) );
- }
- else
- {
- theSortData.nField[0] = nFieldArr[nSort1Pos];
- theSortData.nField[1] = nFieldArr[nSort2Pos];
- theSortData.nField[2] = nFieldArr[nSort3Pos];
- }
-
- theSortData.bAscending[0] = aBtnUp1.IsChecked();
- theSortData.bAscending[1] = aBtnUp2.IsChecked();
- theSortData.bAscending[2] = aBtnUp3.IsChecked();
- // bHasHeader ist in ScTabPageSortOptions::FillItemSet, wo es hingehoert
- }
- else
- {
- theSortData.bDoSort[0] =
- theSortData.bDoSort[1] =
- theSortData.bDoSort[2] = FALSE;
- }
-
- rArgSet.Put( ScSortItem( SCITEM_SORTDATA, NULL, &theSortData ) );
-
- return TRUE;
-}
-
-// -----------------------------------------------------------------------
-
-// fuer Datenaustausch ohne Dialog-Umweg: (! noch zu tun !)
-// void ScTabPageSortFields::ActivatePage( const SfxItemSet& rSet )
-
-void ScTabPageSortFields::ActivatePage()
-{
- if ( pDlg )
- {
- if ( bHasHeader != pDlg->GetHeaders()
- || bSortByRows != pDlg->GetByRows() )
- {
- USHORT nCurSel1 = aLbSort1.GetSelectEntryPos();
- USHORT nCurSel2 = aLbSort2.GetSelectEntryPos();
- USHORT nCurSel3 = aLbSort3.GetSelectEntryPos();
-
- bHasHeader = pDlg->GetHeaders();
- bSortByRows = pDlg->GetByRows();
- FillFieldLists();
- aLbSort1.SelectEntryPos( nCurSel1 );
- aLbSort2.SelectEntryPos( nCurSel2 );
- aLbSort3.SelectEntryPos( nCurSel3 );
- }
- }
-}
-
-// -----------------------------------------------------------------------
-
-int ScTabPageSortFields::DeactivatePage( SfxItemSet* pSetP )
-{
- if ( pDlg )
- {
- if ( bHasHeader != pDlg->GetHeaders() )
- pDlg->SetHeaders( bHasHeader );
-
- if ( bSortByRows != pDlg->GetByRows() )
- pDlg->SetByRows( bSortByRows );
- }
-
- if ( pSetP )
- FillItemSet( *pSetP );
-
- return SfxTabPage::LEAVE_PAGE;
-}
-
-// -----------------------------------------------------------------------
-
-void ScTabPageSortFields::DisableField( USHORT nField )
-{
- nField--;
-
- if ( nField<=2 )
- {
- aSortLbArr[nField] ->Disable();
- aDirBtnArr[nField][0]->Disable();
- aDirBtnArr[nField][1]->Disable();
- aFlArr[nField] ->Disable();
- }
-}
-
-// -----------------------------------------------------------------------
-
-void ScTabPageSortFields::EnableField( USHORT nField )
-{
- nField--;
-
- if ( nField<=2 )
- {
- aSortLbArr[nField] ->Enable();
- aDirBtnArr[nField][0]->Enable();
- aDirBtnArr[nField][1]->Enable();
- aFlArr[nField] ->Enable();
- }
-}
-
-// -----------------------------------------------------------------------
-
-void ScTabPageSortFields::FillFieldLists()
-{
- if ( pViewData )
- {
- ScDocument* pDoc = pViewData->GetDocument();
-
- if ( pDoc )
- {
- aLbSort1.Clear();
- aLbSort2.Clear();
- aLbSort3.Clear();
- aLbSort1.InsertEntry( aStrUndefined, 0 );
- aLbSort2.InsertEntry( aStrUndefined, 0 );
- aLbSort3.InsertEntry( aStrUndefined, 0 );
-
- SCCOL nFirstSortCol = rSortData.nCol1;
- SCROW nFirstSortRow = rSortData.nRow1;
- SCTAB nTab = pViewData->GetTabNo();
- USHORT i = 1;
-
- if ( bSortByRows )
- {
- String aFieldName;
- SCCOL nMaxCol = rSortData.nCol2;
- SCCOL col;
-
- for ( col=nFirstSortCol; col<=nMaxCol && i<SC_MAXFIELDS; col++ )
- {
- pDoc->GetString( col, nFirstSortRow, nTab, aFieldName );
- if ( !bHasHeader || (aFieldName.Len() == 0) )
- {
- aFieldName = aStrColumn;
- aFieldName += ' ';
- aFieldName += ColToAlpha( col );
- }
- nFieldArr[i] = col;
- aLbSort1.InsertEntry( aFieldName, i );
- aLbSort2.InsertEntry( aFieldName, i );
- aLbSort3.InsertEntry( aFieldName, i );
- i++;
- }
- }
- else
- {
- String aFieldName;
- SCROW nMaxRow = rSortData.nRow2;
- SCROW row;
-
- for ( row=nFirstSortRow; row<=nMaxRow && i<SC_MAXFIELDS; row++ )
- {
- pDoc->GetString( nFirstSortCol, row, nTab, aFieldName );
- if ( !bHasHeader || (aFieldName.Len() == 0) )
- {
- aFieldName = aStrRow;
- aFieldName += ' ';
- aFieldName += String::CreateFromInt32( row+1 );
- }
- nFieldArr[i] = row;
- aLbSort1.InsertEntry( aFieldName, i );
- aLbSort2.InsertEntry( aFieldName, i );
- aLbSort3.InsertEntry( aFieldName, i );
- i++;
- }
- }
- nFieldCount = i;
- }
- }
-}
-
-//------------------------------------------------------------------------
-
-USHORT ScTabPageSortFields::GetFieldSelPos( SCCOLROW nField )
-{
- USHORT nFieldPos = 0;
- BOOL bFound = FALSE;
-
- for ( USHORT n=1; n<nFieldCount && !bFound; n++ )
- {
- if ( nFieldArr[n] == nField )
- {
- nFieldPos = n;
- bFound = TRUE;
- }
- }
-
- return nFieldPos;
-}
-
-// -----------------------------------------------------------------------
-// Handler:
-//---------
-
-IMPL_LINK( ScTabPageSortFields, SelectHdl, ListBox *, pLb )
-{
- String aSelEntry = pLb->GetSelectEntry();
-
- if ( pLb == &aLbSort1 )
- {
- if ( aSelEntry == aStrUndefined )
- {
- aLbSort2.SelectEntryPos( 0 );
- aLbSort3.SelectEntryPos( 0 );
-
- if ( aFlSort2.IsEnabled() )
- DisableField( 2 );
-
- if ( aFlSort3.IsEnabled() )
- DisableField( 3 );
- }
- else
- {
- if ( !aFlSort2.IsEnabled() )
- EnableField( 2 );
- }
- }
- else if ( pLb == &aLbSort2 )
- {
- if ( aSelEntry == aStrUndefined )
- {
- aLbSort3.SelectEntryPos( 0 );
- if ( aFlSort3.IsEnabled() )
- DisableField( 3 );
- }
- else
- {
- if ( !aFlSort3.IsEnabled() )
- EnableField( 3 );
- }
- }
- return 0;
-}
-
-//========================================================================
-// Sortieroptionen-Tabpage:
-//========================================================================
-
-#include <layout/layout-pre.hxx>
-
-#if ENABLE_LAYOUT
-#undef ScResId
-#define ScResId(x) #x
-#undef SfxTabPage
-#define SfxTabPage( parent, id, args ) SfxTabPage( parent, "sort-options.xml", id, &args )
-#endif /* ENABLE_LAYOUT */
-
-ScTabPageSortOptions::ScTabPageSortOptions( Window* pParent,
- const SfxItemSet& rArgSet )
-
- : SfxTabPage ( pParent,
- ScResId( RID_SCPAGE_SORT_OPTIONS ),
- rArgSet ),
- //
- aBtnCase ( this, ScResId( BTN_CASESENSITIVE ) ),
- aBtnHeader ( this, ScResId( BTN_LABEL ) ),
- aBtnFormats ( this, ScResId( BTN_FORMATS ) ),
- aBtnCopyResult ( this, ScResId( BTN_COPYRESULT ) ),
- aBtnNaturalSort ( this, ScResId( BTN_NATURALSORT ) ),
- aLbOutPos ( this, ScResId( LB_OUTAREA ) ),
- aEdOutPos ( this, ScResId( ED_OUTAREA ) ),
- aBtnSortUser ( this, ScResId( BTN_SORT_USER ) ),
- aLbSortUser ( this, ScResId( LB_SORT_USER ) ),
- aFtLanguage ( this, ScResId( FT_LANGUAGE ) ),
- aLbLanguage ( this, ScResId( LB_LANGUAGE ) ),
- aFtAlgorithm ( this, ScResId( FT_ALGORITHM ) ),
- aLbAlgorithm ( this, ScResId( LB_ALGORITHM ) ),
- aLineDirection ( this, ScResId( FL_DIRECTION ) ),
- aBtnTopDown ( this, ScResId( BTN_TOP_DOWN ) ),
- aBtnLeftRight ( this, ScResId( BTN_LEFT_RIGHT ) ),
-// aFtAreaLabel ( this, ScResId( FT_AREA_LABEL ) ),
-// aFtArea ( this, ScResId( FT_AREA ) ),
- //
-#if ENABLE_LAYOUT
-#undef this
-#undef ScResId
-#define ScResId(x) this, #x
-#endif /* ENABLE_LAYOUT */
- aStrRowLabel ( ScResId( STR_ROW_LABEL ) ),
- aStrColLabel ( ScResId( STR_COL_LABEL ) ),
- aStrUndefined ( ScResId( SCSTR_UNDEFINED ) ),
- aStrNoName ( ScGlobal::GetRscString(STR_DB_NONAME) ),
- //
-#if !TEST_LAYOUT
- nWhichSort ( rArgSet.GetPool()->GetWhich( SID_SORT ) ),
- rSortData ( ((const ScSortItem&)
- rArgSet.Get( nWhichSort )).GetSortData() ),
-#else /* TEST_LAYOUT */
- nWhichSort ( 0 ),
- rSortData ( *new ScSortParam() ),
-#endif /* TEST_LAYOUT */
- pViewData ( NULL ),
- pDoc ( NULL ),
- pDlg ( (ScSortDlg*)(GetParent() ? GetParent()->GetParent() : 0 ) ),
- pColRes ( NULL ),
- pColWrap ( NULL )
-{
-#if TEST_LAYOUT
- (void) rArgSet;
-#endif /* TEST_LAYOUT */
- Init();
- FreeResource();
- SetExchangeSupport();
-}
-
-// -----------------------------------------------------------------------
-
-ScTabPageSortOptions::~ScTabPageSortOptions()
-{
-#if !TEST_LAYOUT
- USHORT nEntries = aLbOutPos.GetEntryCount();
-
- for ( USHORT i=1; i<nEntries; i++ )
- delete (String*)aLbOutPos.GetEntryData( i );
-#endif /* !TEST_LAYOUT */
-
- delete pColRes;
- delete pColWrap; //! not if from document
-}
-
-// -----------------------------------------------------------------------
-
-void ScTabPageSortOptions::Init()
-{
-// aStrAreaLabel = aFtAreaLabel.GetText();
-// aStrAreaLabel.Append( (sal_Unicode) ' ' );
-
- // CollatorRessource has user-visible names for sort algorithms
- pColRes = new CollatorRessource();
-
- //! use CollatorWrapper from document?
- pColWrap = new CollatorWrapper( comphelper::getProcessServiceFactory() );
-
-#if !TEST_LAYOUT
- const ScSortItem& rSortItem = (const ScSortItem&)
- GetItemSet().Get( nWhichSort );
-#endif /* !TEST_LAYOUT */
-
- aLbOutPos.SetSelectHdl ( LINK( this, ScTabPageSortOptions, SelOutPosHdl ) );
- aBtnCopyResult.SetClickHdl( LINK( this, ScTabPageSortOptions, EnableHdl ) );
- aBtnSortUser.SetClickHdl ( LINK( this, ScTabPageSortOptions, EnableHdl ) );
- aBtnTopDown.SetClickHdl ( LINK( this, ScTabPageSortOptions, SortDirHdl ) );
- aBtnLeftRight.SetClickHdl ( LINK( this, ScTabPageSortOptions, SortDirHdl ) );
- aLbLanguage.SetSelectHdl ( LINK( this, ScTabPageSortOptions, FillAlgorHdl ) );
-
-#if !TEST_LAYOUT
- pViewData = rSortItem.GetViewData();
-#endif /* TEST_LAYOUT */
- pDoc = pViewData ? pViewData->GetDocument() : NULL;
-
- DBG_ASSERT( pViewData, "ViewData not found! :-/" );
-
-#if !TEST_LAYOUT
- if ( pViewData && pDoc )
- {
- String theArea;
- ScDBCollection* pDBColl = pDoc->GetDBCollection();
- String theDbArea;
- String theDbName = aStrNoName;
- const SCTAB nCurTab = pViewData->GetTabNo();
- const ScAddress::Convention eConv = pDoc->GetAddressConvention();
-#endif /* !TEST_LAYOUT */
-
- aLbOutPos.Clear();
- aLbOutPos.InsertEntry( aStrUndefined, 0 );
- aLbOutPos.Disable();
-
-#if !TEST_LAYOUT
- ScAreaNameIterator aIter( pDoc );
- String aName;
- ScRange aRange;
- String aRefStr;
- while ( aIter.Next( aName, aRange ) )
- {
- USHORT nInsert = aLbOutPos.InsertEntry( aName );
-
- aRange.aStart.Format( aRefStr, SCA_ABS_3D, pDoc, eConv );
- aLbOutPos.SetEntryData( nInsert, new String( aRefStr ) );
- }
-#endif /* !TEST_LAYOUT */
-
- aLbOutPos.SelectEntryPos( 0 );
- aEdOutPos.SetText( EMPTY_STRING );
-
-#if !TEST_LAYOUT
- /*
- * Ueberpruefen, ob es sich bei dem uebergebenen
- * Bereich um einen Datenbankbereich handelt:
- */
-
- ScAddress aScAddress( rSortData.nCol1, rSortData.nRow1, nCurTab );
- ScRange( aScAddress,
- ScAddress( rSortData.nCol2, rSortData.nRow2, nCurTab )
- ).Format( theArea, SCR_ABS, pDoc, eConv );
-
- if ( pDBColl )
- {
- ScDBData* pDBData
- = pDBColl->GetDBAtArea( nCurTab,
- rSortData.nCol1, rSortData.nRow1,
- rSortData.nCol2, rSortData.nRow2 );
- if ( pDBData )
- {
- pDBData->GetName( theDbName );
- aBtnHeader.Check( pDBData->HasHeader() );
- }
- }
-
- theArea.AppendAscii(RTL_CONSTASCII_STRINGPARAM(" ("));
- theArea += theDbName;
- theArea += ')';
-
- //aFtArea.SetText( theArea );
- //theArea.Insert( aStrAreaLabel, 0 );
- //aFtAreaLabel.SetText( theArea );
-
- aBtnHeader.SetText( aStrColLabel );
- }
-#endif /* TEST_LAYOUT */
-
- FillUserSortListBox();
-
- // get available languages
-
- aLbLanguage.SetLanguageList( LANG_LIST_ALL | LANG_LIST_ONLY_KNOWN, FALSE );
- aLbLanguage.InsertLanguage( LANGUAGE_SYSTEM );
-}
-
-//------------------------------------------------------------------------
-
-USHORT* ScTabPageSortOptions::GetRanges()
-{
- return pSortRanges;
-}
-
-// -----------------------------------------------------------------------
-
-#if ENABLE_LAYOUT
-#undef SfxTabPage
-#endif /* ENABLE_LAYOUT */
-SfxTabPage* ScTabPageSortOptions::Create(
- Window* pParent,
- const SfxItemSet& rArgSet )
-{
- return ( new ScTabPageSortOptions( pParent, rArgSet ) );
-}
-
-// -----------------------------------------------------------------------
-
-void ScTabPageSortOptions::Reset( const SfxItemSet& /* rArgSet */ )
-{
- if ( rSortData.bUserDef )
- {
- aBtnSortUser.Check( TRUE );
- aLbSortUser.Enable();
- aLbSortUser.SelectEntryPos( rSortData.nUserIndex );
- }
- else
- {
- aBtnSortUser.Check( FALSE );
- aLbSortUser.Disable();
- aLbSortUser.SelectEntryPos( 0 );
- }
-
- aBtnCase.Check ( rSortData.bCaseSens );
- aBtnFormats.Check ( rSortData.bIncludePattern );
- aBtnHeader.Check ( rSortData.bHasHeader );
- aBtnNaturalSort.Check ( rSortData.bNaturalSort );
-
- if ( rSortData.bByRow )
- {
- aBtnTopDown.Check();
- aBtnHeader.SetText( aStrColLabel );
- }
- else
- {
- aBtnLeftRight.Check();
- aBtnHeader.SetText( aStrRowLabel );
- }
-
- LanguageType eLang = MsLangId::convertLocaleToLanguage( rSortData.aCollatorLocale );
- if ( eLang == LANGUAGE_DONTKNOW )
- eLang = LANGUAGE_SYSTEM;
- aLbLanguage.SelectLanguage( eLang );
- FillAlgorHdl( &aLbLanguage ); // get algorithms, select default
- if ( rSortData.aCollatorAlgorithm.Len() )
- aLbAlgorithm.SelectEntry( pColRes->GetTranslation( rSortData.aCollatorAlgorithm ) );
-
- if ( pDoc && !rSortData.bInplace )
- {
- String aStr;
- USHORT nFormat = (rSortData.nDestTab != pViewData->GetTabNo())
- ? SCR_ABS_3D
- : SCR_ABS;
-
- theOutPos.Set( rSortData.nDestCol,
- rSortData.nDestRow,
- rSortData.nDestTab );
-
- theOutPos.Format( aStr, nFormat, pDoc, pDoc->GetAddressConvention() );
- aBtnCopyResult.Check();
- aLbOutPos.Enable();
- aEdOutPos.Enable();
- aEdOutPos.SetText( aStr );
- EdOutPosModHdl( &aEdOutPos );
- aEdOutPos.GrabFocus();
- aEdOutPos.SetSelection( Selection( 0, SELECTION_MAX ) );
- }
- else
- {
- aBtnCopyResult.Check( FALSE );
- aLbOutPos.Disable();
- aEdOutPos.Disable();
- aEdOutPos.SetText( EMPTY_STRING );
- }
-}
-
-// -----------------------------------------------------------------------
-
-BOOL ScTabPageSortOptions::FillItemSet( SfxItemSet& rArgSet )
-{
- ScSortParam theSortData = rSortData;
- if (pDlg)
- {
- const SfxItemSet* pExample = pDlg->GetExampleSet();
- const SfxPoolItem* pItem;
- if ( pExample && pExample->GetItemState( nWhichSort, TRUE, &pItem ) == SFX_ITEM_SET )
- theSortData = ((const ScSortItem*)pItem)->GetSortData();
- }
-
- theSortData.bByRow = aBtnTopDown.IsChecked();
- theSortData.bHasHeader = aBtnHeader.IsChecked();
- theSortData.bCaseSens = aBtnCase.IsChecked();
- theSortData.bNaturalSort = aBtnNaturalSort.IsChecked();
- theSortData.bIncludePattern = aBtnFormats.IsChecked();
- theSortData.bInplace = !aBtnCopyResult.IsChecked();
- theSortData.nDestCol = theOutPos.Col();
- theSortData.nDestRow = theOutPos.Row();
- theSortData.nDestTab = theOutPos.Tab();
- theSortData.bUserDef = aBtnSortUser.IsChecked();
- theSortData.nUserIndex = (aBtnSortUser.IsChecked())
- ? aLbSortUser.GetSelectEntryPos()
- : 0;
-
- // get locale
- LanguageType eLang = aLbLanguage.GetSelectLanguage();
- theSortData.aCollatorLocale = MsLangId::convertLanguageToLocale( eLang, false );
-
- // get algorithm
- String sAlg;
- if ( eLang != LANGUAGE_SYSTEM )
- {
- uno::Sequence<rtl::OUString> aAlgos = pColWrap->listCollatorAlgorithms(
- theSortData.aCollatorLocale );
- USHORT nSel = aLbAlgorithm.GetSelectEntryPos();
- if ( nSel < aAlgos.getLength() )
- sAlg = aAlgos[nSel];
- }
- theSortData.aCollatorAlgorithm = sAlg;
-
-#if !TEST_LAYOUT
- rArgSet.Put( ScSortItem( SCITEM_SORTDATA, &theSortData ) );
-#endif /* TEST_LAYOUT */
- return TRUE;
-}
-
-// -----------------------------------------------------------------------
-
-// fuer Datenaustausch ohne Dialog-Umweg: (! noch zu tun !)
-// void ScTabPageSortOptions::ActivatePage( const SfxItemSet& rSet )
-void ScTabPageSortOptions::ActivatePage()
-{
- if ( pDlg )
- {
- if ( aBtnHeader.IsChecked() != pDlg->GetHeaders() )
- {
- aBtnHeader.Check( pDlg->GetHeaders() );
- }
-
- if ( aBtnTopDown.IsChecked() != pDlg->GetByRows() )
- {
- aBtnTopDown.Check( pDlg->GetByRows() );
- aBtnLeftRight.Check( !pDlg->GetByRows() );
- }
-
- aBtnHeader.SetText( (pDlg->GetByRows())
- ? aStrColLabel
- : aStrRowLabel );
- }
-}
-
-// -----------------------------------------------------------------------
-
-int ScTabPageSortOptions::DeactivatePage( SfxItemSet* pSetP )
-{
- BOOL bPosInputOk = TRUE;
-
- if ( aBtnCopyResult.IsChecked() )
- {
- String thePosStr = aEdOutPos.GetText();
- ScAddress thePos;
- xub_StrLen nColonPos = thePosStr.Search( ':' );
-
- if ( STRING_NOTFOUND != nColonPos )
- thePosStr.Erase( nColonPos );
-
- if ( pViewData )
- {
- // visible table is default for input without table
- // must be changed to GetRefTabNo when sorting has RefInput!
- thePos.SetTab( pViewData->GetTabNo() );
- }
-
- USHORT nResult = thePos.Parse( thePosStr, pDoc, pDoc->GetAddressConvention() );
-
- bPosInputOk = ( SCA_VALID == (nResult & SCA_VALID) );
-
- if ( !bPosInputOk )
- {
-#if !ENABLE_LAYOUT
- ErrorBox( this, WinBits( WB_OK | WB_DEF_OK ),
- ScGlobal::GetRscString( STR_INVALID_TABREF )
- ).Execute();
-#endif /* ENABLE_LAYOUT */
- aEdOutPos.GrabFocus();
- aEdOutPos.SetSelection( Selection( 0, SELECTION_MAX ) );
- theOutPos.Set(0,0,0);
- }
- else
- {
- aEdOutPos.SetText( thePosStr );
- theOutPos = thePos;
- }
- }
-
- if ( pDlg && bPosInputOk )
- {
- pDlg->SetHeaders( aBtnHeader.IsChecked() );
- pDlg->SetByRows ( aBtnTopDown.IsChecked() );
- }
-
- if ( pSetP && bPosInputOk )
- FillItemSet( *pSetP );
-
- return bPosInputOk ? SfxTabPage::LEAVE_PAGE : SfxTabPage::KEEP_PAGE;
-}
-
-// -----------------------------------------------------------------------
-
-void ScTabPageSortOptions::FillUserSortListBox()
-{
- ScUserList* pUserLists = ScGlobal::GetUserList();
-
- aLbSortUser.Clear();
- if ( pUserLists )
- {
- USHORT nCount = pUserLists->GetCount();
- if ( nCount > 0 )
- for ( USHORT i=0; i<nCount; i++ )
- aLbSortUser.InsertEntry( (*pUserLists)[i]->GetString() );
- }
-}
-
-// -----------------------------------------------------------------------
-// Handler:
-
-IMPL_LINK( ScTabPageSortOptions, EnableHdl, CheckBox *, pBox )
-{
- if ( pBox == &aBtnCopyResult )
- {
- if ( pBox->IsChecked() )
- {
- aLbOutPos.Enable();
- aEdOutPos.Enable();
- aEdOutPos.GrabFocus();
- }
- else
- {
- aLbOutPos.Disable();
- aEdOutPos.Disable();
- }
- }
- else if ( pBox == &aBtnSortUser )
- {
- if ( pBox->IsChecked() )
- {
- aLbSortUser.Enable();
- aLbSortUser.GrabFocus();
- }
- else
- aLbSortUser.Disable();
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( ScTabPageSortOptions, SelOutPosHdl, ListBox *, pLb )
-{
- if ( pLb == &aLbOutPos )
- {
- String aString;
- USHORT nSelPos = aLbOutPos.GetSelectEntryPos();
-
- if ( nSelPos > 0 )
- aString = *(String*)aLbOutPos.GetEntryData( nSelPos );
-
- aEdOutPos.SetText( aString );
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( ScTabPageSortOptions, SortDirHdl, RadioButton *, pBtn )
-{
- if ( pBtn == &aBtnTopDown )
- {
- aBtnHeader.SetText( aStrColLabel );
- }
- else if ( pBtn == &aBtnLeftRight )
- {
- aBtnHeader.SetText( aStrRowLabel );
- }
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-void ScTabPageSortOptions::EdOutPosModHdl( Edit* pEd )
-{
- if ( pEd == &aEdOutPos )
- {
- String theCurPosStr = aEdOutPos.GetText();
- USHORT nResult = ScAddress().Parse( theCurPosStr, pDoc, pDoc->GetAddressConvention() );
-
- if ( SCA_VALID == (nResult & SCA_VALID) )
- {
- String* pStr = NULL;
- BOOL bFound = FALSE;
- USHORT i = 0;
- USHORT nCount = aLbOutPos.GetEntryCount();
-
- for ( i=2; i<nCount && !bFound; i++ )
- {
- pStr = (String*)aLbOutPos.GetEntryData( i );
- bFound = (theCurPosStr == *pStr);
- }
-
- if ( bFound )
- aLbOutPos.SelectEntryPos( --i );
- else
- aLbOutPos.SelectEntryPos( 0 );
- }
- }
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( ScTabPageSortOptions, FillAlgorHdl, void *, EMPTYARG )
-{
- aLbAlgorithm.SetUpdateMode( FALSE );
- aLbAlgorithm.Clear();
-
- LanguageType eLang = aLbLanguage.GetSelectLanguage();
- if ( eLang == LANGUAGE_SYSTEM )
- {
- // for LANGUAGE_SYSTEM no algorithm can be selected because
- // it wouldn't necessarily exist for other languages
- // -> leave list box empty if LANGUAGE_SYSTEM is selected
- aFtAlgorithm.Enable( FALSE ); // nothing to select
- aLbAlgorithm.Enable( FALSE ); // nothing to select
- }
- else
- {
- lang::Locale aLocale( MsLangId::convertLanguageToLocale( eLang ));
- uno::Sequence<rtl::OUString> aAlgos = pColWrap->listCollatorAlgorithms( aLocale );
-
- long nCount = aAlgos.getLength();
- const rtl::OUString* pArray = aAlgos.getConstArray();
- for (long i=0; i<nCount; i++)
- {
- String sAlg = pArray[i];
- String sUser = pColRes->GetTranslation( sAlg );
- aLbAlgorithm.InsertEntry( sUser, LISTBOX_APPEND );
- }
- aLbAlgorithm.SelectEntryPos( 0 ); // first entry is default
- aFtAlgorithm.Enable( nCount > 1 ); // enable only if there is a choice
- aLbAlgorithm.Enable( nCount > 1 ); // enable only if there is a choice
- }
-
- aLbAlgorithm.SetUpdateMode( TRUE );
- return 0;
-}
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/workben/layout/tpsort.hxx b/toolkit/workben/layout/tpsort.hxx
deleted file mode 100644
index 64e4f4b6de42..000000000000
--- a/toolkit/workben/layout/tpsort.hxx
+++ /dev/null
@@ -1,219 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef SC_TPSORT_HXX
-#define SC_TPSORT_HXX
-
-
-#include <sfx2/tabdlg.hxx>
-#include <vcl/edit.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/lstbox.hxx>
-#include <svtools/stdctrl.hxx>
-#include <svx/langbox.hxx>
-
-
-#include "global.hxx"
-#include "address.hxx"
-
-//------------------------------------------------------------------------
-
-// +1 because one field is reserved for the "- undefined -" entry
-#define SC_MAXFIELDS MAXCOLCOUNT+1
-
-class ScViewData;
-class ScSortDlg;
-struct ScSortParam;
-
-//========================================================================
-// Kriterien (Sort Criteria)
-
-class ScTabPageSortFields : public SfxTabPage
-{
-public:
- ScTabPageSortFields( Window* pParent,
- const SfxItemSet& rArgSet );
- ~ScTabPageSortFields();
-
- static SfxTabPage* Create ( Window* pParent,
- const SfxItemSet& rArgSet );
- static USHORT* GetRanges ();
- virtual BOOL FillItemSet ( SfxItemSet& rArgSet );
- virtual void Reset ( const SfxItemSet& rArgSet );
-
-protected:
-// fuer Datenaustausch (sollte noch umgestellt werden!)
-// virtual void ActivatePage ( const SfxItemSet& rSet );
- using SfxTabPage::ActivatePage;
- using SfxTabPage::DeactivatePage;
- virtual void ActivatePage ();
- virtual int DeactivatePage ( SfxItemSet* pSet = 0);
-
-private:
- FixedLine aFlSort1;
- ListBox aLbSort1;
- RadioButton aBtnUp1;
- RadioButton aBtnDown1;
-
- FixedLine aFlSort2;
- ListBox aLbSort2;
- RadioButton aBtnUp2;
- RadioButton aBtnDown2;
-
- FixedLine aFlSort3;
- ListBox aLbSort3;
- RadioButton aBtnUp3;
- RadioButton aBtnDown3;
-
- String aStrUndefined;
- String aStrColumn;
- String aStrRow;
-
- const USHORT nWhichSort;
- ScSortDlg* pDlg;
- ScViewData* pViewData;
- const ScSortParam& rSortData;
- SCCOLROW nFieldArr[SC_MAXFIELDS];
- USHORT nFieldCount;
- SCCOL nFirstCol;
- SCROW nFirstRow;
- BOOL bHasHeader;
- BOOL bSortByRows;
-
- ListBox* aSortLbArr[3];
- RadioButton* aDirBtnArr[3][2];
- FixedLine* aFlArr[3];
-
-#ifdef _TPSORT_CXX
-private:
- void Init ();
- void DisableField ( USHORT nField );
- void EnableField ( USHORT nField );
- void FillFieldLists ();
- USHORT GetFieldSelPos ( SCCOLROW nField );
-
- // Handler ------------------------
- DECL_LINK( SelectHdl, ListBox * );
-#endif
-};
-
-//========================================================================
-// Sortieroptionen (Sort Options)
-
-class ScDocument;
-class ScRangeData;
-class CollatorRessource;
-class CollatorWrapper;
-
-#include <sfx2/layout.hxx>
-#include <layout/layout-pre.hxx>
-
-class ScTabPageSortOptions : public SfxTabPage
-{
-public:
- ScTabPageSortOptions( Window* pParent,
- const SfxItemSet& rArgSet );
- ~ScTabPageSortOptions();
-
-#undef SfxTabPage
-#define SfxTabPage ::SfxTabPage
- static SfxTabPage* Create ( Window* pParent,
- const SfxItemSet& rArgSet );
- static USHORT* GetRanges ();
- virtual BOOL FillItemSet ( SfxItemSet& rArgSet );
- virtual void Reset ( const SfxItemSet& rArgSet );
-
-protected:
-// fuer Datenaustausch (sollte noch umgestellt werden!)
-// virtual void ActivatePage ( const SfxItemSet& rSet );
- using SfxTabPage::ActivatePage;
- using SfxTabPage::DeactivatePage;
- virtual void ActivatePage ();
- virtual int DeactivatePage ( SfxItemSet* pSet = 0);
-
-private:
-
- CheckBox aBtnCase;
- CheckBox aBtnHeader;
- CheckBox aBtnFormats;
- CheckBox aBtnCopyResult;
-
- CheckBox aBtnNaturalSort;
- ListBox aLbOutPos;
- Edit aEdOutPos;
-
- CheckBox aBtnSortUser;
- ListBox aLbSortUser;
-
- FixedText aFtLanguage;
- SvxLanguageBox aLbLanguage;
- FixedText aFtAlgorithm;
- ListBox aLbAlgorithm;
-
- FixedLine aLineDirection;
- RadioButton aBtnTopDown;
- RadioButton aBtnLeftRight;
-
-// FixedText aFtAreaLabel;
-// FixedInfo aFtArea;
- LocalizedString aStrRowLabel;
- LocalizedString aStrColLabel;
- LocalizedString aStrUndefined;
- String aStrNoName;
- String aStrAreaLabel;
-
- const USHORT nWhichSort;
- const ScSortParam& rSortData;
- ScViewData* pViewData;
- ScDocument* pDoc;
- ScSortDlg* pDlg;
- ScAddress theOutPos;
-
- CollatorRessource* pColRes;
- CollatorWrapper* pColWrap;
-
-#ifdef _TPSORT_CXX
-private:
- void Init ();
- void FillUserSortListBox ();
- void FillOutPosList ();
-
- // Handler ------------------------
- DECL_LINK( EnableHdl, CheckBox * );
- DECL_LINK( SelOutPosHdl, ListBox * );
- void EdOutPosModHdl ( Edit* pEd );
- DECL_LINK( SortDirHdl, RadioButton * );
- DECL_LINK( FillAlgorHdl, void * );
-#endif
-};
-
-#include <layout/layout-post.hxx>
-
-#endif // SC_TPSORT_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/workben/layout/un-test.sh b/toolkit/workben/layout/un-test.sh
deleted file mode 100644
index ef2518ffa1b8..000000000000
--- a/toolkit/workben/layout/un-test.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#! /bin/sh
-
-# un-test.sh: remove TEST_LAYOUT code from OO.o implementation
-
-sed -e 's!^#!@!' < $1\
- -e 's!$! /*$*/!' \
- -e 's!^@\(.*TEST_LAYOUT\)!#\1!'\
- | tee i \
- | cpp -traditional -C -CC -DNON_LAYOUT_COMPILE_FIXES=1 \
- | grep -F '/*$*/' \
- | sed -e 's! /\*\$\*/!!' \
- -e 's!^@!#!' \
- -e 's!#define 1 1!#define NON_LAYOUT_COMPILE_FIXES 1!'
-
diff --git a/toolkit/workben/layout/uno.hxx b/toolkit/workben/layout/uno.hxx
deleted file mode 100644
index 94a70e9fdc1e..000000000000
--- a/toolkit/workben/layout/uno.hxx
+++ /dev/null
@@ -1,109 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _LAYOUT_UNO_HXX
-#define _LAYOUT_UNO_HXX
-
-#include <cstdio>
-#include <com/sun/star/lang/XComponent.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-
-#include <layout/core/root.hxx>
-#include <layout/core/factory.hxx>
-
-#if LAYOUT_WEAK
-#include <cppuhelper/implbase1.hxx>
-class UnoBootstrapLayout : public ::cppu::WeakImplHelper1< com::sun::star::lang::XMultiServiceFactory >
-#else /* !LAYOUT_WEAK */
-class UnoBootstrapLayout : public com::sun::star::lang::XMultiServiceFactory
-#endif /* LAYOUT_WEAK */
-{
-public:
- com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > mxMSF;
- UnoBootstrapLayout( com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > xMSF )
- : mxMSF( xMSF )
- {
- fprintf( stderr, "UnoBootstrap Layout\n" );
- }
- virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL
- createInstance( const rtl::OUString& aServiceSpecifier ) throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException)
- {
- if ( aServiceSpecifier.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.awt.Layout" ) ) )
- {
- fprintf( stderr, "UnoBootstrapLayout: create service '%s'\n",
- rtl::OUStringToOString (aServiceSpecifier, RTL_TEXTENCODING_UTF8 ).getStr() );
- return com::sun::star::uno::Reference< com::sun::star::lang::XSingleServiceFactory >( new ::LayoutFactory( this ) );
- }
- else
- {
- fprintf( stderr, "UnoBootstrapLayout: create service '%s'\n",
- rtl::OUStringToOString (aServiceSpecifier, RTL_TEXTENCODING_UTF8 ).getStr() );
- try
- {
- return mxMSF->createInstance( aServiceSpecifier );
- }
- catch ( const com::sun::star::uno::Exception &rExc )
- {
- rtl::OString aStr( rtl::OUStringToOString( rExc.Message, RTL_TEXTENCODING_ASCII_US ) );
- fprintf( stderr, "service construction exception '%s'\n", aStr.getStr());
- throw rExc;
- }
- }
- }
- virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL
- createInstanceWithArguments( const rtl::OUString& ServiceSpecifier, const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& Arguments ) throw (com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException)
- {
- return mxMSF->createInstanceWithArguments( ServiceSpecifier, Arguments );
- }
- virtual com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL
- getAvailableServiceNames() throw (com::sun::star::uno::RuntimeException)
- {
- return mxMSF->getAvailableServiceNames();
- }
-
-#if !LAYOUT_WEAK
- // XInterface
- virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException)
- {
- return mxMSF->queryInterface( rType );
- }
- virtual void SAL_CALL acquire() throw()
- {
- mxMSF->acquire();
- }
- virtual void SAL_CALL release() throw()
- {
- mxMSF->release();
- }
-#endif /* !LAYOUT_WEAK */
-};
-
-#endif /* _LAYOUT_UNO_HXX */
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/workben/layout/wordcount-plain.xml b/toolkit/workben/layout/wordcount-plain.xml
deleted file mode 100644
index 5adce42acdbd..000000000000
--- a/toolkit/workben/layout/wordcount-plain.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-<modaldialog sizeable="true" height="132" help-id="HID_DLG_WORDCOUNT" moveable="true" output-size="true" id="DLG_WORDCOUNT" sv-look="true" text="Word Count" width="170" xmlns="http://openoffice.org/2007/layout" xmlns:cnt="http://openoffice.org/2007/layout/container">
- <vbox>
- <fixedline height="8" id="FL_CURRENT" text="Current selection" width="158" x="6" y="3"/>
- <hbox>
- <fixedtext height="8" id="FT_CURRENTWORD" label="Words:" width="80" x="12" y="14"/>
- <fixedtext height="8" id="FI_CURRENTWORD" right="true" width="50" x="111" y="14"/>
- </hbox>
- <hbox>
- <fixedtext height="8" id="FT_CURRENTCHARACTER" label="Characters:" width="80" x="12" y="26"/>
- <fixedtext height="8" id="FI_CURRENTCHARACTER" right="true" width="50" x="111" y="26"/>
- </hbox>
- <hbox>
- <fixedtext height="8" id="FT_CURRENTCHARACTEREXCLUDINGSPACES" label="Characters excluding spaces:" width="80" x="12" y="38"/>
- <fixedtext height="8" id="FI_CURRENTCHARACTEREXCLUDINGSPACES" right="true" width="50" x="111" y="38"/>
- </hbox>
- <fixedline height="8" id="FL_DOC" text="Whole document" width="158" x="6" y="52"/>
- <hbox>
- <fixedtext height="8" id="FT_DOCWORD" label="Words:" width="80" x="12" y="63"/>
- <fixedtext height="8" id="FI_DOCWORD" right="true" width="50" x="111" y="63"/>
- </hbox>
- <hbox>
- <fixedtext height="8" id="FT_DOCCHARACTER" label="Characters:" width="80" x="12" y="75"/>
- <fixedtext height="8" id="FI_DOCCHARACTER" right="true" width="50" x="111" y="75"/>
- </hbox>
- <hbox>
- <fixedtext height="8" id="FT_DOCCHARACTEREXCLUDINGSPACES" label="Characters excluding spaces:" width="80" x="12" y="87"/>
- <fixedtext height="8" id="FI_DOCCHARACTEREXCLUDINGSPACES" right="true" width="50" x="111" y="87"/>
- </hbox>
- <fixedline height="8" id="FL_BOTTOM" width="158" x="6" y="101"/>
- <hbox>
- <okbutton defbutton="true" height="14" id="PB_OK" width="50" x="61" y="112"/>
- <helpbutton height="14" id="PB_HELP" width="50" x="114" y="112"/>
- </hbox>
- </vbox>
-</modaldialog>
diff --git a/toolkit/workben/layout/wordcount-tight.xml b/toolkit/workben/layout/wordcount-tight.xml
deleted file mode 100644
index bcf6a6d86fca..000000000000
--- a/toolkit/workben/layout/wordcount-tight.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<modaldialog xmlns="http://openoffice.org/2007/layout"
- xmlns:cnt="http://openoffice.org/2007/layout/container"
- help-id="HID_DLG_WORDCOUNT"
- id="dialog"
- sizeable="true" moveable="true" optimumsize="true"
- has_border="true" sv-look="true" title="Word Count">
- <vbox border="5" spacing="5">
- <fixedline id="FL_CURRENT" text="Current selection"/>
- <hbox>
- <fixedtext id="FT_CURRENTWORD" label="Words:" cnt:padding="13"/>
- <fixedinfo id="FI_CURRENTWORD" right="true" label="0" cnt:padding="13"/>
- </hbox>
- <hbox>
- <fixedtext id="FT_CURRENTCHARACTER" label="Characters:" cnt:padding="13"/>
- <fixedinfo id="FI_CURRENTCHARACTER" right="true" label="00" cnt:padding="13"/>
- </hbox>
- <hbox>
- <fixedtext id="FT_CURRENTCHARACTEREXCLUDINGSPACES" label="Characters excluding spaces:" cnt:padding="13"/>
- <fixedinfo id="FI_CURRENTCHARACTEREXCLUDINGSPACES" right="true" label="000" cnt:padding="13"/>
- </hbox>
- <fixedline id="FL_DOC" text="Whole document"/>
- <hbox>
- <fixedtext id="FT_DOCWORD" label="Words:" cnt:padding="13"/>
- <fixedinfo id="FI_DOCWORD" right="true" label="0000" cnt:padding="13"/>
- </hbox>
- <hbox>
- <fixedtext id="FT_DOCCHARACTER" label="Characters:" cnt:padding="13"/>
- <fixedinfo id="FI_DOCCHARACTER" right="true" label="00000" cnt:padding="13"/>
- </hbox>
- <hbox>
- <fixedtext id="FT_DOCCHARACTEREXCLUDINGSPACES" label="Characters excluding spaces:" cnt:padding="13"/>
- <fixedinfo id="FI_DOCCHARACTEREXCLUDINGSPACES" right="true" label="000000" cnt:padding="13"/>
- </hbox>
- <fixedline cnt:padding="1" id="FL_BOTTOM"/>
- <hbox border="5">
- <flow homogeneous="true"/>
- <okbutton id="PB_OK" cnt:expand="false" defbutton="true"/>
- <helpbutton id="PB_HELP" cnt:expand="false"/>
- </hbox>
- </vbox>
-</modaldialog>
diff --git a/toolkit/workben/layout/wordcount.xml b/toolkit/workben/layout/wordcount.xml
deleted file mode 100644
index 4b4e362e8583..000000000000
--- a/toolkit/workben/layout/wordcount.xml
+++ /dev/null
@@ -1,59 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- This is a template. i18n translation is not performed in-place;
- i18n translated xml files are generated from this template by
- transex3/layout/tralay. !-->
-
-<modaldialog xmlns="http://openoffice.org/2007/layout"
- xmlns:cnt="http://openoffice.org/2007/layout/container"
- help-id="HID_DLG_WORDCOUNT"
- id="DLG_WORDCOUNT"
- sizeable="true" moveable="true" optimumsize="true" closeable="true"
- has_border="true" sv-look="true" _title="Word Count">
- <vbox border="12" spacing="6">
- <fixedline id="FL_CURRENT" _text="Current selection"/>
- <hbox>
- <vbox cnt:padding="12" spacing="6">
- <hbox>
- <fixedtext id="FT_CURRENTWORD" _label="Words:"/>
- <flow cnt:padding="60"/>
- <fixedtext id="FI_CURRENTWORD" right="true" _label="0"/>
- </hbox>
- <hbox>
- <fixedtext id="FT_CURRENTCHARACTER" _label="Characters:"/>
- <flow cnt:padding="60"/>
- <fixedtext id="FI_CURRENTCHARACTER" right="true" _label="00"/>
- </hbox>
- <hbox>
- <fixedtext id="FT_CURRENTCHARACTEREXCLUDINGSPACES" _label="Characters excluding spaces:"/>
- <flow cnt:padding="60"/>
- <fixedtext id="FI_CURRENTCHARACTEREXCLUDINGSPACES" right="true" _label="000"/>
- </hbox>
- </vbox>
- </hbox>
- <!-- if we could do cnt:cnt:padding="-12" here, we would not have to close
- and reopen the hbox/vbox thing !-->
- <fixedline id="FL_DOC" _text="Whole document"/>
- <hbox>
- <vbox cnt:padding="12" spacing="6">
- <hbox>
- <fixedtext id="FT_DOCWORD" _label="Words:"/>
- <fixedtext id="FI_DOCWORD" right="true" _label="0000"/>
- </hbox>
- <hbox>
- <fixedtext id="FT_DOCCHARACTER" _label="Characters:"/>
- <fixedtext id="FI_DOCCHARACTER" right="true" _label="00000"/>
- </hbox>
- <hbox>
- <fixedtext id="FT_DOCCHARACTEREXCLUDINGSPACES" _label="Characters excluding spaces:"/>
- <fixedtext id="FI_DOCCHARACTEREXCLUDINGSPACES" right="true" _label="000000"/>
- </hbox>
- </vbox>
- </hbox>
- <fixedline cnt:padding="1" id="FL_BOTTOM"/>
- <dialogbuttonhbox spacing="12">
- <flow/>
- <okbutton defbutton="true" id="PB_OK"/>
- <helpbutton id="PB_HELP"/>
- </dialogbuttonhbox>
- </vbox>
-</modaldialog>
diff --git a/toolkit/workben/layout/wordcountdialog.cxx b/toolkit/workben/layout/wordcountdialog.cxx
deleted file mode 100644
index da0083e09456..000000000000
--- a/toolkit/workben/layout/wordcountdialog.cxx
+++ /dev/null
@@ -1,111 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#if !TEST_LAYOUT
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sw.hxx"
-#ifdef SW_DLLIMPLEMENTATION
-#undef SW_DLLIMPLEMENTATION
-#endif
-#include <swtypes.hxx>
-#endif /* !TEST_LAYOUT */
-#include <wordcountdialog.hxx>
-#if !TEST_LAYOUT
-#include <docstat.hxx>
-
-#include <dialog.hrc>
-#endif /* !TEST_LAYOUT */
-#include <layout/layout-pre.hxx>
-#if !TEST_LAYOUT
-#include <wordcountdialog.hrc>
-#endif /* !TEST_LAYOUT */
-
-#if ENABLE_LAYOUT
-#undef SW_RES
-#define SW_RES(x) #x
-#undef SfxModalDialog
-#define SfxModalDialog( parent, id ) Dialog( parent, "wordcount.xml", id )
-#define SW_WORDCOUNTDIALOG_HRC
-#include <helpid.h>
-#endif /* ENABLE_LAYOUT */
-
-SwWordCountDialog::SwWordCountDialog(Window* pParent) :
- SfxModalDialog(pParent, SW_RES(DLG_WORDCOUNT)),
-#if defined _MSC_VER
-#pragma warning (disable : 4355)
-#endif
- aCurrentFL( this, SW_RES( FL_CURRENT )),
- aCurrentWordFT( this, SW_RES( FT_CURRENTWORD )),
- aCurrentWordFI( this, SW_RES( FI_CURRENTWORD )),
- aCurrentCharacterFT( this, SW_RES( FT_CURRENTCHARACTER )),
- aCurrentCharacterFI( this, SW_RES( FI_CURRENTCHARACTER )),
- aCurrentCharacterExcludingSpacesFT( this, SW_RES( FT_CURRENTCHARACTEREXCLUDINGSPACES )),
- aCurrentCharacterExcludingSpacesFI( this, SW_RES( FI_CURRENTCHARACTEREXCLUDINGSPACES )),
-
- aDocFL( this, SW_RES( FL_DOC )),
- aDocWordFT( this, SW_RES( FT_DOCWORD )),
- aDocWordFI( this, SW_RES( FI_DOCWORD )),
- aDocCharacterFT( this, SW_RES( FT_DOCCHARACTER )),
- aDocCharacterFI( this, SW_RES( FI_DOCCHARACTER )),
- aDocCharacterExcludingSpacesFT( this, SW_RES( FT_DOCCHARACTEREXCLUDINGSPACES )),
- aDocCharacterExcludingSpacesFI( this, SW_RES( FI_DOCCHARACTEREXCLUDINGSPACES )),
- aBottomFL(this, SW_RES( FL_BOTTOM )),
- aOK( this, SW_RES( PB_OK )),
- aHelp( this, SW_RES( PB_HELP ))
-#if defined _MSC_VER
-#pragma warning (default : 4355)
-#endif
-{
-#if ENABLE_LAYOUT
- SetHelpId (HID_DLG_WORDCOUNT);
-#endif /* ENABLE_LAYOUT */
- FreeResource();
-}
-
-SwWordCountDialog::~SwWordCountDialog()
-{
-}
-
-void SwWordCountDialog::SetValues(const SwDocStat& rCurrent, const SwDocStat& rDoc)
-{
-#if TEST_LAYOUT
- (void) rCurrent;
- (void) rDoc;
-#else /* !TEST_LAYOUT */
- aCurrentWordFI.SetText( String::CreateFromInt32(rCurrent.nWord ));
- aCurrentCharacterFI.SetText(String::CreateFromInt32(rCurrent.nChar ));
- aCurrentCharacterExcludingSpacesFI.SetText(String::CreateFromInt32(rCurrent.nCharExcludingSpaces ));
- aDocWordFI.SetText( String::CreateFromInt32(rDoc.nWord ));
- aDocCharacterFI.SetText( String::CreateFromInt32(rDoc.nChar ));
- aDocCharacterExcludingSpacesFI.SetText( String::CreateFromInt32(rDoc.nCharExcludingSpaces ));
-#endif /* !TEST_LAYOUT */
-}
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/workben/layout/wordcountdialog.hxx b/toolkit/workben/layout/wordcountdialog.hxx
deleted file mode 100644
index 5c6dbabea04f..000000000000
--- a/toolkit/workben/layout/wordcountdialog.hxx
+++ /dev/null
@@ -1,70 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef SW_WORDCOUNTDIALOG_HXX
-#define SW_WORDCOUNTDIALOG_HXX
-#include <sfx2/basedlgs.hxx>
-#include <svtools/stdctrl.hxx>
-#include <vcl/button.hxx>
-#include <layout/layout.hxx>
-#include <layout/layout-pre.hxx>
-struct SwDocStat;
-class SwWordCountDialog : public SfxModalDialog
-{
- FixedLine aCurrentFL;
- FixedText aCurrentWordFT;
- FixedInfo aCurrentWordFI;
- FixedText aCurrentCharacterFT;
- FixedInfo aCurrentCharacterFI;
- FixedText aCurrentCharacterExcludingSpacesFT;
- FixedInfo aCurrentCharacterExcludingSpacesFI;
-
- FixedLine aDocFL;
- FixedText aDocWordFT;
- FixedInfo aDocWordFI;
- FixedText aDocCharacterFT;
- FixedInfo aDocCharacterFI;
- FixedText aDocCharacterExcludingSpacesFT;
- FixedInfo aDocCharacterExcludingSpacesFI;
-
- FixedLine aBottomFL;
-
- OKButton aOK;
- HelpButton aHelp;
-
-public:
- SwWordCountDialog(Window* pParent);
- ~SwWordCountDialog();
-
- void SetValues(const SwDocStat& rCurrent, const SwDocStat& rDoc);
-};
-
-#include <layout/layout-post.hxx>
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/workben/layout/zoom-1.xml b/toolkit/workben/layout/zoom-1.xml
deleted file mode 100644
index 5fe06a3f270e..000000000000
--- a/toolkit/workben/layout/zoom-1.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<modaldialog xmlns="http://openoffice.org/2007/layout"
- xmlns:cnt="http://openoffice.org/2007/layout/container"
- id="dialog" optimumsize="true"
- help-id="SID_ATTR_ZOOM"
- has_border="true" sizeable="true" moveable="true">
- <title id="tit" xml-lang="en-US">Set Zoom</title>
- <vbox spacing="5" border="5">
- <fixedline id="FL_ZOOM" cnt:expand="true" xml-lang="en-US">Zoom factor</fixedline>
- <radiobutton radiogroup="zoom" id="BTN_WHOLE_PAGE" xml-lang="en-US">Whole Page</radiobutton>
- <radiobutton radiogroup="zoom" id="BTN_PAGE_WIDTH" xml-lang="en-US">Page Width</radiobutton>
- <radiobutton radiogroup="zoom" id="BTN_OPTIMAL" xml-lang="en-US">Optimal</radiobutton>
- <radiobutton radiogroup="zoom" id="BTN_200" xml-lang="en-US">200 %</radiobutton>
- <radiobutton radiogroup="zoom" id="BTN_150" xml-lang="en-US">15~0 %</radiobutton>
- <radiobutton radiogroup="zoom" id="BTN_100" xml-lang="en-US">100 %</radiobutton>
- <radiobutton radiogroup="zoom" id="BTN_75" xml-lang="en-US">75 %</radiobutton>
- <radiobutton radiogroup="zoom" id="BTN_50" xml-lang="en-US">50 %</radiobutton>
- <hbox cnt:expand="false" cnt:fill="true">
- <align cnt:expand="false" cnt:fill="true">
- <radiobutton cnt:v-align="0.5" cnt:v-fill="0" radiogroup="zoom" id="BTN_USER" xml-lang="en-US">Variable</radiobutton>
- </align>
- <flow cnt:padding="10" cnt:expand="false"/>
- <metricfield id="ED_USER" value-step="1"
- repeat="true" has_border="true" spin="true"
- text="100%" unit="13" custom-unit-text="%"
- right="true"
- cnt:expand="false"/>
- </hbox>
- <fixedline cnt:padding="1" id="FL_BOTTOM"/>
- <dialogbuttonhbox border="5" spacing="5">
- <flow/>
- <okbutton id="BTN_ZOOM_OK"/>
- <cancelbutton id="BTN_ZOOM_CANCEL"/>
- <helpbutton id="BTN_ZOOM_HELP"/>
- </dialogbuttonhbox>
- </vbox>
-</modaldialog>
diff --git a/toolkit/workben/layout/zoom-2.xml b/toolkit/workben/layout/zoom-2.xml
deleted file mode 100644
index c74e0c9a9da7..000000000000
--- a/toolkit/workben/layout/zoom-2.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<modaldialog xmlns="http://openoffice.org/2007/layout"
- xmlns:cnt="http://openoffice.org/2007/layout/container"
- id="dialog" optimumsize="true"
- help-id="SID_ATTR_ZOOM"
- has_border="true" sizeable="true" moveable="true"
- xml-lang="en-US">
- Set Zoom
- <vbox spacing="5" border="5">
- <fixedline id="FL_ZOOM" cnt:expand="true" xml-lang="en-US">Zoom factor</fixedline>
- <radiobutton radiogroup="zoom" id="BTN_WHOLE_PAGE" xml-lang="en-US">Whole Page</radiobutton>
- <radiobutton radiogroup="zoom" id="BTN_PAGE_WIDTH" xml-lang="en-US">Page Width</radiobutton>
- <radiobutton radiogroup="zoom" id="BTN_OPTIMAL" xml-lang="en-US">Optimal</radiobutton>
- <radiobutton radiogroup="zoom" id="BTN_200" xml-lang="en-US">200 %</radiobutton>
- <radiobutton radiogroup="zoom" id="BTN_150" xml-lang="en-US">15~0 %</radiobutton>
- <radiobutton radiogroup="zoom" id="BTN_100" xml-lang="en-US">100 %</radiobutton>
- <radiobutton radiogroup="zoom" id="BTN_75" xml-lang="en-US">75 %</radiobutton>
- <radiobutton radiogroup="zoom" id="BTN_50" xml-lang="en-US">50 %</radiobutton>
- <hbox cnt:expand="false" cnt:fill="true">
- <align cnt:expand="false" cnt:fill="true">
- <radiobutton cnt:v-align="0.5" cnt:v-fill="0" radiogroup="zoom" id="BTN_USER" xml-lang="en-US">Variable</radiobutton>
- </align>
- <flow cnt:padding="10" cnt:expand="false"/>
- <metricfield id="ED_USER" value-step="1"
- repeat="true" has_border="true" spin="true"
- text="100%" unit="13" custom-unit-text="%"
- right="true"
- cnt:expand="false"/>
- </hbox>
- <fixedline cnt:padding="1" id="FL_BOTTOM"/>
- <dialogbuttonhbox border="5" spacing="5">
- <flow/>
- <okbutton id="BTN_ZOOM_OK"/>
- <cancelbutton id="BTN_ZOOM_CANCEL"/>
- <helpbutton id="BTN_ZOOM_HELP"/>
- </dialogbuttonhbox>
- </vbox>
-</modaldialog>
diff --git a/toolkit/workben/layout/zoom-indent.xml b/toolkit/workben/layout/zoom-indent.xml
deleted file mode 100644
index bd5853acdce4..000000000000
--- a/toolkit/workben/layout/zoom-indent.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<modaldialog xmlns="http://openoffice.org/2007/layout"
- xmlns:cnt="http://openoffice.org/2007/layout/container"
- id="dialog" title="Set Zoom" optimumsize="true"
- help-id="SID_ATTR_ZOOM"
- has_border="true" sizeable="true" moveable="true">
- <hbox border="5" spacing="0">
- <vbox spacing="0">
- <fixedline id="FixedLine" text="Zoom factor" cnt:expand="true"/>
- <hbox> <!-- for left margin !-->
- <vbox cnt:padding="13" spacing="4" cnt:expand="true">
- <radiobutton radiogroup="zoom" id="WholePage" label="Whole Page"/>
- <radiobutton radiogroup="zoom" id="PageWidth" label="Page Width"/>
- <radiobutton radiogroup="zoom" id="Optimal" label="Optimal"/>
- <radiobutton radiogroup="zoom" id="Zoom200" label="~200 %"/>
- <radiobutton radiogroup="zoom" id="Zoom150" label="15~0 %"/>
- <radiobutton radiogroup="zoom" id="Zoom100" label="~100 %"/>
- <radiobutton radiogroup="zoom" id="Zoom75" label="~75 %"/>
- <radiobutton radiogroup="zoom" id="Zoom50" label="~50 %"/>
- <hbox cnt:expand="false">
- <align cnt:expand="false">
- <radiobutton cnt:v-align="0.5" cnt:v-fill="0" radiogroup="zoom" id="BtnUser" label="~Variable"/>
- </align>
- <flow cnt:padding="10" cnt:expand="false"/>
- <metricfield id="User" value-step="1"
- repeat="true" has_border="true" spin="true"
- text="100%" unit="11" custom-unit-text="%"
- right="true"/>
- <flow cnt:padding="10" cnt:expand="true"/>
- </hbox>
- </vbox>
- </hbox>
- </vbox>
- <vbox border="6" spacing="4">
- <okbutton id="OkButton" cnt:expand="false" defbutton="true"/>
- <cancelbutton id="CancelButton" cnt:expand="false"/>
- <helpbutton id="HelpButton" cnt:expand="false"/>
- </vbox>
- </hbox>
-</modaldialog>
diff --git a/toolkit/workben/layout/zoom-plain.xml b/toolkit/workben/layout/zoom-plain.xml
deleted file mode 100644
index c8383b8767a7..000000000000
--- a/toolkit/workben/layout/zoom-plain.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-<modaldialog sizeable="true" height="142" help-id="SID_ATTR_ZOOM" moveable="true" output-size="true" id="RID_SVXDLG_ZOOM" sv-look="true" text="Zoom" width="160" xmlns="http://openoffice.org/2007/layout" xmlns:cnt="http://openoffice.org/2007/layout/container">
- <vbox>
- <fixedline height="8" id="FL_ZOOM" text="Zoom factor" width="92" x="6" y="3"/>
- <okbutton defbutton="true" height="14" id="BTN_ZOOM_OK" width="50" x="104" y="6"/>
- <radiobutton height="10" id="BTN_WHOLE_PAGE" width="80" x="12" y="14"/>
- <cancelbutton height="14" id="BTN_ZOOM_CANCEL" width="50" x="104" y="23"/>
- <radiobutton height="10" id="BTN_PAGE_WIDTH" width="80" x="12" y="27"/>
- <radiobutton height="10" id="BTN_OPTIMAL" width="80" x="12" y="40"/>
- <helpbutton height="14" id="BTN_ZOOM_HELP" width="50" x="104" y="43"/>
- <radiobutton height="10" id="BTN_200" label="~200 %" width="80" x="12" y="53"/>
- <radiobutton height="10" id="BTN_150" label="15~0 %" width="80" x="12" y="66"/>
- <radiobutton height="10" id="BTN_100" label="~100 %" width="80" x="12" y="79"/>
- <radiobutton height="10" id="BTN_75" label="~75 %" width="80" x="12" y="92"/>
- <radiobutton height="10" id="BTN_50" label="~50 %" width="80" x="12" y="105"/>
- <metricfield has_border="true" custom-unit-text="%" group="true" height="12" left="true" repeat="true" id="ED_USER" spin="true" step-size="1" unit="FUNIT_CUSTOM" width="36" x="56" y="120"/>
- <radiobutton height="10" id="BTN_USER" label="~Variable" width="42" x="12" y="121"/>
- </vbox>
-</modaldialog>
diff --git a/toolkit/workben/layout/zoom.cxx b/toolkit/workben/layout/zoom.cxx
deleted file mode 100644
index d05074908475..000000000000
--- a/toolkit/workben/layout/zoom.cxx
+++ /dev/null
@@ -1,614 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#if !TEST_LAYOUT
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_svx.hxx"
-#endif /* !TEST_LAYOUT */
-
-#ifdef SVX_DLLIMPLEMENTATION
-#undef SVX_DLLIMPLEMENTATION
-#endif
-
-// include ---------------------------------------------------------------
-
-#if TEST_LAYOUT
-#include <cstdio>
-#endif /* TEST_LAYOUT */
-#include <tools/shl.hxx>
-#include <svtools/itemset.hxx>
-#include <svtools/itempool.hxx>
-#include <sfx2/objsh.hxx>
-#include <vcl/msgbox.hxx>
-
-#define _SVX_ZOOM_CXX
-
-#include <svx/dialogs.hrc>
-#if !TEST_LAYOUT
-#include "zoom.hrc"
-#endif /* !TEST_LAYOUT */
-
-#include "zoom.hxx"
-#if TEST_LAYOUT
-#define SVX_ZOOM_OPTIMAL "Zoom optimal"
-#define SVX_ZOOM_PAGEWIDTH "Zoom page width"
-#define SVX_ZOOM_WHOLEPAGE "Zoom whole page"
-struct SvxZoomItem
-{
- void SetType( char const* s )
- {
- fputs( s, stderr );
- }
-
- void SetValue( int n )
- {
- fprintf( stderr, "Zoom factor: %d\n", int( n ) );
- }
-};
-#define SfxPoolItem LAYOUT_SfxPoolItem
-class LAYOUT_SfxPoolItem
-{
-};
-struct SvxViewLayoutItem : public LAYOUT_SfxPoolItem
-{
- bool IsBookMode()
- {
- return false;
- }
- USHORT GetValue()
- {
- return 0;
- }
-
- void SetValue( int n )
- {
- fprintf( stderr, "Zoom factor: %d\n", int( n ) );
- }
- void SetBookMode( bool )
- {
- }
-};
-#else /* !TEST_LAYOUT */
-#include <svx/zoomitem.hxx>
-#include <svx/viewlayoutitem.hxx>
-#include <svx/dialmgr.hxx>
-#endif /* !TEST_LAYOUT */
-#include "zoom_def.hxx"
-
-#include <layout/layout-pre.hxx>
-
-#if ENABLE_LAYOUT
-#undef SVX_RES
-#define SVX_RES(x) #x
-#undef SfxModalDialog
-#define SfxModalDialog( parent, id ) Dialog( parent, "zoom.xml", id )
-#endif /* ENABLE_LAYOUT */
-
-// static ----------------------------------------------------------------
-
-static USHORT pRanges[] =
-{
- SID_ATTR_ZOOM,
- SID_ATTR_ZOOM,
- 0
-};
-
-#define SPECIAL_FACTOR ((USHORT)0xFFFF)
-
-// class SvxZoomDialog ---------------------------------------------------
-
-USHORT SvxZoomDialog::GetFactor() const
-{
- if ( a100Btn.IsChecked() )
- return 100;
- if ( aUserBtn.IsChecked() )
- return (USHORT)aUserEdit.GetValue();
- else
- return SPECIAL_FACTOR;
-}
-
-// -----------------------------------------------------------------------
-
-void SvxZoomDialog::SetFactor( USHORT nNewFactor, USHORT nBtnId )
-{
-#if TEST_LAYOUT
- printf ("\t\t set factor %d\n", (int)nNewFactor);
-#endif /* !TEST_LAYOUT */
- aUserEdit.Disable();
-
- if ( !nBtnId )
- {
- if ( nNewFactor == 100 )
- {
- a100Btn.Check();
- a100Btn.GrabFocus();
- }
- else
- {
- aUserBtn.Check();
- aUserEdit.Enable();
- aUserEdit.SetValue( (long)nNewFactor );
- aUserEdit.GrabFocus();
- }
- }
- else
- {
- aUserEdit.SetValue( (long)nNewFactor );
-
- if ( ZOOMBTN_OPTIMAL == nBtnId )
- {
- aOptimalBtn.Check();
- aOptimalBtn.GrabFocus();
- }
- else if ( ZOOMBTN_PAGEWIDTH == nBtnId )
- {
- aPageWidthBtn.Check();
- aPageWidthBtn.GrabFocus();
- }
- else if ( ZOOMBTN_WHOLEPAGE == nBtnId )
- {
- aWholePageBtn.Check();
- aWholePageBtn.GrabFocus();
- }
- }
-}
-
-// -----------------------------------------------------------------------
-
-void SvxZoomDialog::SetButtonText( USHORT nBtnId, const String& rNewTxt )
-{
- switch ( nBtnId )
- {
- case ZOOMBTN_OPTIMAL: // Optimal-Button
- aOptimalBtn.SetText( rNewTxt );
- break;
-
- case ZOOMBTN_PAGEWIDTH: // Seitenbreite-Button
- aPageWidthBtn.SetText( rNewTxt );
- break;
-
- case ZOOMBTN_WHOLEPAGE: // Ganze Seite-Button
- aWholePageBtn.SetText( rNewTxt );
- break;
-
- default:
- OSL_FAIL( "wrong button number" );
- }
-}
-
-// -----------------------------------------------------------------------
-
-void SvxZoomDialog::HideButton( USHORT nBtnId )
-{
- switch ( nBtnId )
- {
- case ZOOMBTN_OPTIMAL: // Optimal-Button
- aOptimalBtn.Hide();
- break;
-
- case ZOOMBTN_PAGEWIDTH: // Seitenbreite-Button
- aPageWidthBtn.Hide();
- break;
-
- case ZOOMBTN_WHOLEPAGE: // Ganze Seite-Button
- aWholePageBtn.Hide();
- break;
-
- default:
- OSL_FAIL( "Falsche Button-Nummer!!!" );
- }
-}
-
-// -----------------------------------------------------------------------
-
-void SvxZoomDialog::SetLimits( USHORT nMin, USHORT nMax )
-{
- DBG_ASSERT( nMin < nMax, "invalid limits" );
- aUserEdit.SetMin( nMin );
- aUserEdit.SetFirst( nMin );
- aUserEdit.SetMax( nMax );
- aUserEdit.SetLast( nMax );
-}
-
-// -----------------------------------------------------------------------
-
-void SvxZoomDialog::SetSpinSize( USHORT nNewSpin )
-{
- aUserEdit.SetSpinSize( nNewSpin );
-}
-
-// -----------------------------------------------------------------------
-
-#if TEST_LAYOUT
-SvxZoomDialog::SvxZoomDialog( Window* pParent ) :
-#else /* !TEST_LAYOUT */
-SvxZoomDialog::SvxZoomDialog( Window* pParent, const SfxItemSet& rCoreSet ) :
-#endif /* !TEST_LAYOUT */
-
- SfxModalDialog( pParent, SVX_RES( RID_SVXDLG_ZOOM ) ),
-
- aZoomFl ( this, SVX_RES( FL_ZOOM ) ),
- aOptimalBtn ( this, SVX_RES( BTN_OPTIMAL ) ),
- aWholePageBtn ( this, SVX_RES( BTN_WHOLE_PAGE ) ),
- aPageWidthBtn ( this, SVX_RES( BTN_PAGE_WIDTH ) ),
- a100Btn ( this, SVX_RES( BTN_100 ) ),
- aUserBtn ( this, SVX_RES( BTN_USER ) ),
- aUserEdit ( this, SVX_RES( ED_USER ) ),
-
- aViewLayoutFl ( this, SVX_RES( FL_VIEWLAYOUT ) ),
- aAutomaticBtn ( this, SVX_RES( BTN_AUTOMATIC ) ),
- aSingleBtn ( this, SVX_RES( BTN_SINGLE ) ),
- aColumnsBtn ( this, SVX_RES( BTN_COLUMNS ) ),
- aColumnsEdit ( this, SVX_RES( ED_COLUMNS ) ),
- aBookModeChk ( this, SVX_RES( CHK_BOOK ) ),
-
- aBottomFl ( this, SVX_RES( FL_BOTTOM ) ),
- aOKBtn ( this, SVX_RES( BTN_ZOOM_OK ) ),
- aCancelBtn ( this, SVX_RES( BTN_ZOOM_CANCEL ) ),
- aHelpBtn ( this, SVX_RES( BTN_ZOOM_HELP ) ),
-
-#if !TEST_LAYOUT
- rSet ( rCoreSet ),
-#endif /* !TEST_LAYOUT */
- pOutSet ( NULL ),
- bModified ( FALSE )
-
-{
-#if ENABLE_LAYOUT
- SetHelpId (SID_ATTR_ZOOM);
-#endif /* ENABLE_LAYOUT */
- Link aLink = LINK( this, SvxZoomDialog, UserHdl );
- a100Btn.SetClickHdl( aLink );
- aOptimalBtn.SetClickHdl( aLink );
- aPageWidthBtn.SetClickHdl( aLink );
- aWholePageBtn.SetClickHdl( aLink );
- aUserBtn.SetClickHdl( aLink );
-
- Link aViewLayoutLink = LINK( this, SvxZoomDialog, ViewLayoutUserHdl );
- aAutomaticBtn.SetClickHdl( aViewLayoutLink );
- aSingleBtn.SetClickHdl( aViewLayoutLink );
- aColumnsBtn.SetClickHdl( aViewLayoutLink );
-
- Link aViewLayoutSpinLink = LINK( this, SvxZoomDialog, ViewLayoutSpinHdl );
- aColumnsEdit.SetModifyHdl( aViewLayoutSpinLink );
-
- Link aViewLayoutCheckLink = LINK( this, SvxZoomDialog, ViewLayoutCheckHdl );
- aBookModeChk.SetClickHdl( aViewLayoutCheckLink );
-
- aOKBtn.SetClickHdl( LINK( this, SvxZoomDialog, OKHdl ) );
- aUserEdit.SetModifyHdl( LINK( this, SvxZoomDialog, SpinHdl ) );
-
- // Default-Werte
- USHORT nValue = 100;
- USHORT nMin = 10;
- USHORT nMax = 1000;
-
-#if !TEST_LAYOUT
- // ggf. erst den alten Wert besorgen
- const SfxUInt16Item* pOldUserItem = 0;
- SfxObjectShell* pSh = SfxObjectShell::Current();
-
- if ( pSh )
- pOldUserItem = (const SfxUInt16Item*)pSh->GetItem( SID_ATTR_ZOOM_USER );
-
- if ( pOldUserItem )
- nValue = pOldUserItem->GetValue();
-
- // UserEdit initialisieren
- if ( nMin > nValue )
- nMin = nValue;
- if ( nMax < nValue )
- nMax = nValue;
-#endif /* !TEST_LAYOUT */
- aUserEdit.SetMin( nMin );
- aUserEdit.SetFirst( nMin );
- aUserEdit.SetMax( nMax );
- aUserEdit.SetLast( nMax );
- aUserEdit.SetValue( nValue );
-
-#if TEST_LAYOUT
- USHORT nZoom = 100;
- SetFactor( nZoom );
-#else /* !TEST_LAYOUT */
- const SfxPoolItem& rItem = rSet.Get( rSet.GetPool()->GetWhich( SID_ATTR_ZOOM ) );
-
- if ( rItem.ISA(SvxZoomItem) )
- {
- const SvxZoomItem& rZoomItem = (const SvxZoomItem&)rItem;
- const USHORT nZoom = rZoomItem.GetValue();
- const SvxZoomType eType = rZoomItem.GetType();
- const USHORT nValSet = rZoomItem.GetValueSet();
- USHORT nBtnId = 0;
-
- switch ( eType )
- {
- case SVX_ZOOM_OPTIMAL:
- nBtnId = ZOOMBTN_OPTIMAL;
- break;
- case SVX_ZOOM_PAGEWIDTH:
- nBtnId = ZOOMBTN_PAGEWIDTH;
- break;
- case SVX_ZOOM_WHOLEPAGE:
- nBtnId = ZOOMBTN_WHOLEPAGE;
- break;
- case SVX_ZOOM_PERCENT:
- break;
- case SVX_ZOOM_PAGEWIDTH_NOBORDER:
- break;
- }
-
- if ( !(SVX_ZOOM_ENABLE_100 & nValSet) )
- a100Btn.Disable();
- if ( !(SVX_ZOOM_ENABLE_OPTIMAL & nValSet) )
- aOptimalBtn.Disable();
- if ( !(SVX_ZOOM_ENABLE_PAGEWIDTH & nValSet) )
- aPageWidthBtn.Disable();
- if ( !(SVX_ZOOM_ENABLE_WHOLEPAGE & nValSet) )
- aWholePageBtn.Disable();
- SetFactor( nZoom, nBtnId );
- }
- else
- {
- const USHORT nZoom = ( (const SfxUInt16Item&)rItem ).GetValue();
- SetFactor( nZoom );
- }
-
- const SfxPoolItem* pViewLayoutItem = 0;
- if ( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_VIEWLAYOUT, FALSE, &pViewLayoutItem ) )
- {
- const USHORT nColumns = static_cast<const SvxViewLayoutItem*>(pViewLayoutItem)->GetValue();
- const bool bBookMode = static_cast<const SvxViewLayoutItem*>(pViewLayoutItem)->IsBookMode();
-
- if ( 0 == nColumns )
- {
- aAutomaticBtn.Check();
- aColumnsEdit.SetValue( 2 );
- aColumnsEdit.Disable();
- aBookModeChk.Disable();
- }
- else if ( 1 == nColumns)
- {
- aSingleBtn.Check();
- aColumnsEdit.SetValue( 2 );
- aColumnsEdit.Disable();
- aBookModeChk.Disable();
- }
- else
- {
- aColumnsBtn.Check();
- if ( !bBookMode )
- {
- aColumnsEdit.SetValue( nColumns );
- if ( 0 != nColumns % 2 )
- aBookModeChk.Disable();
- }
- else
- {
- aColumnsEdit.SetValue( nColumns );
- aBookModeChk.Check();
- }
- }
- }
- else
- {
- // hide view layout related controls:
- aViewLayoutFl.Disable();
- aAutomaticBtn.Disable();
- aSingleBtn.Disable();
- aColumnsBtn.Disable();
- aColumnsEdit.Disable();
- aBookModeChk.Disable();
- }
-#endif /* !TEST_LAYOUT */
-
- FreeResource();
-}
-
-// -----------------------------------------------------------------------
-
-SvxZoomDialog::~SvxZoomDialog()
-{
- delete pOutSet;
- pOutSet = 0;
-}
-
-// -----------------------------------------------------------------------
-
-USHORT* SvxZoomDialog::GetRanges()
-{
- return pRanges;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxZoomDialog, UserHdl, RadioButton *, pBtn )
-{
-#if TEST_LAYOUT
- fprintf( stderr, "SvxZoomDialog::UserHdl\n" );
-#endif /* TEST_LAYOUT */
- bModified |= TRUE;
-
- if ( pBtn == &aUserBtn )
- {
- aUserEdit.Enable();
- aUserEdit.GrabFocus();
- }
- else
- aUserEdit.Disable();
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxZoomDialog, SpinHdl, MetricField *, EMPTYARG )
-{
- if ( !aUserBtn.IsChecked() )
- return 0;
- bModified |= TRUE;
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxZoomDialog, ViewLayoutUserHdl, RadioButton *, pBtn )
-{
- bModified |= TRUE;
-
- if ( pBtn == &aAutomaticBtn )
- {
- aColumnsEdit.Disable();
- aBookModeChk.Disable();
- }
- else if ( pBtn == &aSingleBtn )
- {
- aColumnsEdit.Disable();
- aBookModeChk.Disable();
- }
- else if ( pBtn == &aColumnsBtn )
- {
- aColumnsEdit.Enable();
- aColumnsEdit.GrabFocus();
- if ( 0 == aColumnsEdit.GetValue() % 2 )
- aBookModeChk.Enable();
- }
- else
- {
- OSL_FAIL( "Wrong Button" );
- return 0;
- }
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxZoomDialog, ViewLayoutSpinHdl, MetricField *, pEdt )
-{
- if ( pEdt == &aColumnsEdit && !aColumnsBtn.IsChecked() )
- return 0;
-
- if ( 0 == aColumnsEdit.GetValue() % 2 )
- aBookModeChk.Enable();
- else
- {
- aBookModeChk.Check( sal_False );
- aBookModeChk.Disable();
- }
-
- bModified |= TRUE;
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxZoomDialog, ViewLayoutCheckHdl, CheckBox *, pChk )
-{
- if ( pChk == &aBookModeChk && !aColumnsBtn.IsChecked() )
- return 0;
-
- bModified |= TRUE;
-
- return 0;
-}
-
-// -----------------------------------------------------------------------
-
-IMPL_LINK( SvxZoomDialog, OKHdl, Button *, pBtn )
-{
- if ( bModified || &aOKBtn != pBtn )
- {
-#if TEST_LAYOUT
- SvxZoomItem aZoomItem;
- SvxViewLayoutItem aViewLayoutItem;
-#else /* !TEST_LAYOUT */
- SvxZoomItem aZoomItem( SVX_ZOOM_PERCENT, 0, rSet.GetPool()->GetWhich( SID_ATTR_ZOOM ) );
- SvxViewLayoutItem aViewLayoutItem( 0, false, rSet.GetPool()->GetWhich( SID_ATTR_VIEWLAYOUT ) );
-#endif /* !TEST_LAYOUT */
-
- if ( &aOKBtn == pBtn )
- {
- USHORT nFactor = GetFactor();
-
- if ( SPECIAL_FACTOR == nFactor )
- {
- if ( aOptimalBtn.IsChecked() )
- aZoomItem.SetType( SVX_ZOOM_OPTIMAL );
- else if ( aPageWidthBtn.IsChecked() )
- aZoomItem.SetType( SVX_ZOOM_PAGEWIDTH );
- else if ( aWholePageBtn.IsChecked() )
- aZoomItem.SetType( SVX_ZOOM_WHOLEPAGE );
- }
- else
- aZoomItem.SetValue( nFactor );
-
- if ( aAutomaticBtn.IsChecked() )
- {
- aViewLayoutItem.SetValue( 0 );
- aViewLayoutItem.SetBookMode( false );
- }
- if ( aSingleBtn.IsChecked() )
- {
- aViewLayoutItem.SetValue( 1 );
- aViewLayoutItem.SetBookMode( false );
- }
- else if ( aColumnsBtn.IsChecked() )
- {
- aViewLayoutItem.SetValue( static_cast<USHORT>(aColumnsEdit.GetValue()) );
- aViewLayoutItem.SetBookMode( aBookModeChk.IsChecked() );
- }
- }
- else
- {
- OSL_FAIL( "Wrong Button" );
- return 0;
- }
-#if !TEST_LAYOUT
- pOutSet = new SfxItemSet( rSet );
- pOutSet->Put( aZoomItem );
-
- // don't set attribute in case the whole viewlayout stuff is disabled:
- if ( aViewLayoutFl.IsEnabled() )
- pOutSet->Put( aViewLayoutItem );
-
- // Wert aus dem UserEdit "uber den Dialog hinaus merken
- SfxObjectShell* pSh = SfxObjectShell::Current();
-
- if ( pSh )
- pSh->PutItem( SfxUInt16Item( SID_ATTR_ZOOM_USER,
- (UINT16)aUserEdit.GetValue() ) );
-#endif /* !TEST_LAYOUT */
- EndDialog( RET_OK );
- }
- else
- EndDialog( RET_CANCEL );
- return 0;
-}
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/workben/layout/zoom.hrc b/toolkit/workben/layout/zoom.hrc
deleted file mode 100644
index 49412ad085f0..000000000000
--- a/toolkit/workben/layout/zoom.hrc
+++ /dev/null
@@ -1,53 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_ZOOM_HRC
-#define _SVX_ZOOM_HRC
-
-// defines ------------------------------------------------------------------
-
-#define FL_ZOOM 14
-#define BTN_OPTIMAL 15
-#define BTN_WHOLE_PAGE 16
-#define BTN_PAGE_WIDTH 17
-#define BTN_100 18
-#define BTN_USER 19
-#define ED_USER 20
-
-#define FL_VIEWLAYOUT 21
-#define BTN_AUTOMATIC 22
-#define BTN_SINGLE 23
-#define BTN_COLUMNS 24
-#define ED_COLUMNS 25
-#define CHK_BOOK 26
-
-#define FL_BOTTOM 27
-#define BTN_ZOOM_OK 28
-#define BTN_ZOOM_CANCEL 29
-#define BTN_ZOOM_HELP 30
-
-#endif
-
diff --git a/toolkit/workben/layout/zoom.hxx b/toolkit/workben/layout/zoom.hxx
deleted file mode 100644
index 0fab50eb1ced..000000000000
--- a/toolkit/workben/layout/zoom.hxx
+++ /dev/null
@@ -1,121 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-#ifndef _SVX_ZOOM_HXX
-#define _SVX_ZOOM_HXX
-
-// include ---------------------------------------------------------------
-
-#include <layout/layout.hxx>
-#include <sfx2/basedlgs.hxx>
-#include <vcl/button.hxx>
-#include <vcl/field.hxx>
-#include <vcl/fixed.hxx>
-
-// define ----------------------------------------------------------------
-/* CHINA001
-#define ZOOMBTN_OPTIMAL ((USHORT)0x0001)
-#define ZOOMBTN_PAGEWIDTH ((USHORT)0x0002)
-#define ZOOMBTN_WHOLEPAGE ((USHORT)0x0004)
-*/
-#include "zoom_def.hxx"
-// class SvxZoomDialog ---------------------------------------------------
-/*
- {k:\svx\prototyp\dialog\zoom.bmp}
-
- [Beschreibung]
- Mit diesem Dialog wird ein Zoom-Faktor eingestellt.
-
- [Items]
- SvxZoomItem <SID_ATTR_ZOOM>
-*/
-
-#include <layout/layout-pre.hxx>
-
-class SvxZoomDialog : public SfxModalDialog
-{
-private:
- FixedLine aZoomFl;
- RadioButton aOptimalBtn;
- RadioButton aWholePageBtn;
- RadioButton aPageWidthBtn;
- RadioButton a100Btn;
- RadioButton aUserBtn;
- MetricField aUserEdit;
-
- FixedLine aViewLayoutFl;
- RadioButton aAutomaticBtn;
- RadioButton aSingleBtn;
- RadioButton aColumnsBtn;
- MetricField aColumnsEdit;
- CheckBox aBookModeChk;
-
- FixedLine aBottomFl;
- OKButton aOKBtn;
- CancelButton aCancelBtn;
- HelpButton aHelpBtn;
-
-#if !TEST_LAYOUT
- const SfxItemSet& rSet;
-#endif /* !TEST_LAYOUT */
- SfxItemSet* pOutSet;
- BOOL bModified;
-
-#ifdef _SVX_ZOOM_CXX
- DECL_LINK( UserHdl, RadioButton* );
- DECL_LINK( SpinHdl, MetricField* );
- DECL_LINK( ViewLayoutUserHdl, RadioButton* );
- DECL_LINK( ViewLayoutSpinHdl, MetricField* );
- DECL_LINK( ViewLayoutCheckHdl, CheckBox* );
- DECL_LINK( OKHdl, Button* );
-#endif
-
-public:
-#if TEST_LAYOUT
- SvxZoomDialog( Window* pParent );
-#else /* !TEST_LAYOUT */
- SvxZoomDialog( Window* pParent, const SfxItemSet& rCoreSet );
-#endif /* !TEST_LAYOUT */
- ~SvxZoomDialog();
-
- static USHORT* GetRanges();
- const SfxItemSet* GetOutputItemSet() const { return pOutSet; }
-
- USHORT GetFactor() const;
- void SetFactor( USHORT nNewFactor, USHORT nBtnId = 0 );
-
- void SetButtonText( USHORT nBtnId, const String& aNewTxt );
- void HideButton( USHORT nBtnId );
- void SetLimits( USHORT nMin, USHORT nMax );
- void SetSpinSize( USHORT nNewSpin );
-};
-
-#include <layout/layout-post.hxx>
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/workben/layout/zoom.xml b/toolkit/workben/layout/zoom.xml
deleted file mode 100644
index 5cc376168a27..000000000000
--- a/toolkit/workben/layout/zoom.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- This is a template. i18n translation is not performed in-place;
- i18n translated xml files are generated from this template by
- transex3/layout/tralay. !-->
-
-<modaldialog xmlns="http://openoffice.org/2007/layout"
- xmlns:cnt="http://openoffice.org/2007/layout/container"
- id="RID_SVXDLG_ZOOM" _title="Zoom &amp; View Layout" optimumsize="true"
- help-id="SID_ATTR_ZOOM"
- has_border="true" sizeable="true" moveable="true" closeable="true">
- <vbox spacing="0" border="12">
- <hbox spacing="0" border="0">
- <vbox spacing="6" border="0">
- <fixedline id="FL_ZOOM" _text="Zoom factor" cnt:expand="false"/>
- <radiobutton radiogroup="zoom-factor" id="BTN_OPTIMAL" _label="Optimal"/>
- <radiobutton radiogroup="zoom-factor" id="BTN_WHOLE_PAGE" _label="Whole Page"/>
- <radiobutton radiogroup="zoom-factor" id="BTN_PAGE_WIDTH" _label="Page Width"/>
- <radiobutton radiogroup="zoom-factor" id="BTN_100" _label="100 %"/>
- <hbox cnt:expand="false" cnt:fill="true">
- <align cnt:expand="false" cnt:fill="true">
- <radiobutton cnt:v-align="0.5" cnt:v-fill="0" radiogroup="zoom-factor" id="BTN_USER" _label="Variable"/>
- </align>
- <flow cnt:padding="12" cnt:expand="false"/>
- <metricfield id="ED_USER" value-step="1"
- repeat="true" has_border="true" spin="true"
- _text="100%" unit="11" custom-unit-text="%"
- right="true"
- cnt:expand="false"/>
- </hbox>
- </vbox>
- <flow/>
- <vbox spacing="6" border="0">
- <fixedline id="FL_VIEWLAYOUT" _text="View layout" cnt:expand="false"/>
- <radiobutton radiogroup="zoom-layout" id="BTN_AUTOMATIC" _label="~Automatic"/>
- <radiobutton radiogroup="zoom-layout" id="BTN_SINGLE" _label="~Single page"/>
- <hbox cnt:expand="false" cnt:fill="true">
- <align cnt:expand="false" cnt:fill="true">
- <radiobutton cnt:v-align="0.5" cnt:v-fill="0" radiogroup="zoom-layout" id="BTN_COLUMNS" _label="~Columns"/>
- </align>
- <flow cnt:padding="12" cnt:expand="false"/>
- <metricfield id="ED_COLUMNS" value-step="1"
- repeat="true" has_border="true" spin="true"
- _text="100%"
- right="true"
- spin-value-min="1"
- spin-value="1"
- cnt:expand="false"/>
- </hbox>
- <hbox><flow cnt:expand="false" cnt:padding="12"/><checkbox id="CHK_BOOK" _label="~Book mode"/></hbox>
- </vbox>
- </hbox>
- <fixedline cnt:padding="6" id="FL_BOTTOM"/>
- <dialogbuttonhbox border="0" spacing="12">
- <flow/>
- <okbutton defbutton="true" id="BTN_ZOOM_OK"/>
- <cancelbutton id="BTN_ZOOM_CANCEL"/>
- <helpbutton id="BTN_ZOOM_HELP"/>
- </dialogbuttonhbox>
- </vbox>
-</modaldialog>
diff --git a/toolkit/workben/layout/zoom_def.hxx b/toolkit/workben/layout/zoom_def.hxx
deleted file mode 100644
index 84b2db945a6e..000000000000
--- a/toolkit/workben/layout/zoom_def.hxx
+++ /dev/null
@@ -1,38 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SVX_ZOOM_DEF_HXX
-#define _SVX_ZOOM_DEF_HXX
-
-#define ZOOMBTN_OPTIMAL ((USHORT)0x0001)
-#define ZOOMBTN_PAGEWIDTH ((USHORT)0x0002)
-#define ZOOMBTN_WHOLEPAGE ((USHORT)0x0004)
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/workben/no_localization b/toolkit/workben/no_localization
deleted file mode 100644
index 3ce3aa0ec048..000000000000
--- a/toolkit/workben/no_localization
+++ /dev/null
@@ -1 +0,0 @@
-Touch me to prevent that the localisation process extracts strings #i85733#
diff --git a/toolkit/workben/unodialog.cxx b/toolkit/workben/unodialog.cxx
deleted file mode 100644
index 4652457766c2..000000000000
--- a/toolkit/workben/unodialog.cxx
+++ /dev/null
@@ -1,270 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_toolkit.hxx"
-#include <sal/main.h>
-#include <com/sun/star/awt/XToolkit.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/container/XNameContainer.hpp>
-#include <com/sun/star/awt/XControlModel.hpp>
-#include <com/sun/star/awt/XControlContainer.hpp>
-#include <com/sun/star/awt/XControl.hpp>
-#include <com/sun/star/awt/XDialog.hpp>
-
-
-#include <tools/debug.hxx>
-#include <vcl/svapp.hxx>
-#include <vcl/wrkwin.hxx>
-
-#include <svtools/unoiface.hxx> // InitExtToolkit
-#include <comphelper/processfactory.hxx>
-
-#include <cppuhelper/servicefactory.hxx>
-#include <cppuhelper/bootstrap.hxx>
-#include <comphelper/regpathhelper.hxx>
-
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/registry/XSimpleRegistry.hpp>
-
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::connection;
-using namespace ::rtl;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::registry;
-using namespace ::com::sun::star::lang;
-
-
-
-::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > createApplicationServiceManager()
-{
- try
- {
- ::rtl::OUString localRegistry = ::comphelper::getPathToUserRegistry();
- ::rtl::OUString systemRegistry = ::comphelper::getPathToSystemRegistry();
-
- Reference< XSimpleRegistry > xLocalRegistry( ::cppu::createSimpleRegistry() );
- Reference< XSimpleRegistry > xSystemRegistry( ::cppu::createSimpleRegistry() );
- if ( xLocalRegistry.is() && (localRegistry.getLength() > 0) )
- {
- try
- {
- xLocalRegistry->open( localRegistry, sal_False, sal_True);
- }
- catch ( InvalidRegistryException& )
- {
- }
-
- if ( !xLocalRegistry->isValid() )
- xLocalRegistry->open(localRegistry, sal_True, sal_True);
- }
-
- if ( xSystemRegistry.is() && (systemRegistry.getLength() > 0) )
- xSystemRegistry->open( systemRegistry, sal_True, sal_False);
-
- if ( (xLocalRegistry.is() && xLocalRegistry->isValid()) &&
- (xSystemRegistry.is() && xSystemRegistry->isValid()) )
- {
- Reference < XSimpleRegistry > xReg( ::cppu::createNestedRegistry() );
- Sequence< Any > seqAnys(2);
- seqAnys[0] <<= xLocalRegistry ;
- seqAnys[1] <<= xSystemRegistry ;
- Reference< XInitialization > xInit( xReg, UNO_QUERY );
- xInit->initialize( seqAnys );
-
- Reference< XComponentContext > xContext( ::cppu::bootstrap_InitialComponentContext( xReg ) );
- return Reference< XMultiServiceFactory >( xContext->getServiceManager(), UNO_QUERY );
- }
- }
- catch( ::com::sun::star::uno::Exception& )
- {
- }
-
- return ::cppu::createServiceFactory();
-}
-
-
-// -----------------------------------------------------------------------
-void Main( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & );
-
-SAL_IMPLEMENT_MAIN()
-{
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xMSF = createApplicationServiceManager();
- //SVInit( xMSF );
- ::Main( xMSF );
- //SVDeinit();
- return NULL;
-}
-
-/*
-class MyApp : public Application
-{
-public:
- void Main()
- {
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xMSF = createApplicationServiceManager();
- ::Main( xMSF );
- }
-};
-
-MyApp aMyApp;
-*/
-
-
-class MyWin : public WorkWindow
-{
-private:
- uno::Reference< awt::XView > mxView;
-
-public:
- MyWin() : WorkWindow( NULL, WB_APP|WB_STDWORK ) {;}
- void Paint( const Rectangle& r );
- void SetXView( uno::Reference< awt::XView > xV ) { mxView = xV; }
-};
-
-
-// -----------------------------------------------------------------------
-
-void Main( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & xMSF )
-{
- ::comphelper::setProcessServiceFactory( xMSF );
-
- //uno::Reference< awt::XToolkit> xToolkit( xMSF->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.ExtToolkit" ) ) ), uno::UNO_QUERY );
- uno::Reference< awt::XToolkit> xToolkit( xMSF->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.Toolkit" ) ) ), uno::UNO_QUERY );
-
- // Create a DialogModel
- uno::Reference< container::XNameContainer > xC( xMSF->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlDialogModel" ) ) ), uno::UNO_QUERY );
- uno::Reference< lang::XMultiServiceFactory > xModFact( xC, uno::UNO_QUERY );
-
- // Create a ButtonModel
- uno::Reference< awt::XControlModel > xCtrl1( xModFact->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlButtonModel" ) ) ), uno::UNO_QUERY );
- uno::Reference< beans::XPropertySet > xPSet( xCtrl1, uno::UNO_QUERY );
- uno::Any aValue;
- aValue <<= (sal_Int32) 10;
- xPSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "PositionX" ) ), aValue );
- aValue <<= (sal_Int32) 10;
- xPSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "PositionY" ) ), aValue );
- aValue <<= (sal_Int32) 40;
- xPSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Width" ) ), aValue );
- aValue <<= (sal_Int32) 12;
- xPSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Height" ) ), aValue );
- aValue <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Test!" ) );
- xPSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Label" ) ), aValue );
- uno::Any aAny;
- aAny <<= xCtrl1;
- xC->insertByName( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Control1" ) ), aAny );
-
- uno::Reference< beans::XPropertySet > xDlgPSet( xC, uno::UNO_QUERY );
- aValue <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Test-Dialog" ) );
- xDlgPSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Title" ) ), aValue );
- aValue <<= (sal_Int32) 200;
- xDlgPSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Width" ) ), aValue );
- aValue <<= (sal_Int32) 200;
- xDlgPSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Height" ) ), aValue );
-
- // Create a Dialog
- uno::Reference< awt::XControl > xDlg( xMSF->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlDialog" ) ) ), uno::UNO_QUERY );
- uno::Reference< awt::XControlModel > xDlgMod( xC, uno::UNO_QUERY );
- xDlg->setModel( xDlgMod );
-
- // Create a EditModel
- uno::Reference< awt::XControlModel > xCtrl2( xModFact->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlEditModel" ) ) ), uno::UNO_QUERY );
- xPSet = uno::Reference< beans::XPropertySet >( xCtrl2, uno::UNO_QUERY );
- aValue <<= (sal_Int32) 10;
- xPSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "PositionX" ) ), aValue );
- aValue <<= (sal_Int32) 40;
- xPSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "PositionY" ) ), aValue );
- aValue <<= (sal_Int32) 80;
- xPSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Width" ) ), aValue );
- aValue <<= (sal_Int32) 12;
- xPSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Height" ) ), aValue );
- aValue <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Text..." ) );
- xPSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Text" ) ), aValue );
- aAny <<= xCtrl2;
- xC->insertByName( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Control2" ) ), aAny );
-
- // test if listener works...
- aValue <<= (sal_Int32) 20;
- xPSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "PositionX" ) ), aValue );
-
- MyWin * pWindow;
- ::SolarMutexGuard aVclGuard;
-
- pWindow = new MyWin();
- pWindow->Show();
-
- xDlg->setDesignMode( sal_True );
-
- uno::Reference< awt::XWindow > xWindow( xDlg, uno::UNO_QUERY );
- xWindow->setVisible( sal_False );
-
- xDlg->createPeer( xToolkit, pWindow->GetComponentInterface() );
-
- uno::Reference< awt::XView > xView( xDlg, uno::UNO_QUERY );
- pWindow->SetXView( xView );
-
- uno::Reference< awt::XDialog > xD( xDlg, uno::UNO_QUERY );
-
- //static BOOL bExecute = FALSE;
- //if ( bExecute )
- xD->execute();
- //Execute();
- Reference< XComponent > xDT( xD, uno::UNO_QUERY );
- xDT->dispose();
- delete pWindow;
-
- Reference< XComponent > xT( xToolkit, uno::UNO_QUERY );
- xT->dispose();
-
- Reference< beans::XPropertySet > xProps( ::comphelper::getProcessServiceFactory(), UNO_QUERY );
- if (xProps.is())
- {
- try
- {
- Reference< lang::XComponent > xComp;
- if (xProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("DefaultContext") ) ) >>= xComp)
- {
- xComp->dispose();
- }
- }
- catch (beans::UnknownPropertyException &)
- {
- }
- }
-}
-
-void MyWin::Paint( const Rectangle& r )
-{
- static BOOL bDraw = TRUE;
- if ( bDraw && mxView.is() )
- mxView->draw( 50, 50 );
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */