From c37b517f073811efd68a03b68b810067cebfab85 Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Wed, 16 Jul 2008 16:25:55 +0200
Subject: [PATCH] Initial conversion of insert-sheet dialog.

---
 sc/source/ui/inc/instbdlg.hxx       |    5 +++++
 sc/source/ui/inc/strindlg.hxx       |    4 ++--
 sc/source/ui/miscdlgs/instbdlg.cxx  |   16 ++++++++++++++++
 sc/uiconfig/layout/insert-sheet.xml |   28 ++++++++++++++++++++++++++++
 sc/uiconfig/layout/makefile.mk      |    1 +
 5 files changed, 52 insertions(+), 2 deletions(-)
 create mode 100644 sc/uiconfig/layout/insert-sheet.xml

diff --git a/sc/source/ui/inc/instbdlg.hxx b/sc/source/ui/inc/instbdlg.hxx
index 3e2b6de..563b253 100644
--- a/sc/source/ui/inc/instbdlg.hxx
+++ b/sc/source/ui/inc/instbdlg.hxx
@@ -56,6 +56,9 @@
 #include <vcl/field.hxx>
 #include "expftext.hxx"
 
+#include <layout/layout.hxx>
+#include <layout/layout-pre.hxx>
+
 class ScViewData;
 class ScDocument;
 class ScDocShell;
@@ -130,5 +133,7 @@ private:
 #endif
 };
 
+#include <layout/layout-post.hxx>
+
 #endif // SC_INSTBDLG_HXX
 
diff --git a/sc/source/ui/inc/strindlg.hxx b/sc/source/ui/inc/strindlg.hxx
index defc5ba..5cc06c6 100644
--- a/sc/source/ui/inc/strindlg.hxx
+++ b/sc/source/ui/inc/strindlg.hxx
@@ -37,11 +37,11 @@
 #include <vcl/imagebtn.hxx>
 #include <vcl/edit.hxx>
 
-//------------------------------------------------------------------------
-
 #include <layout/layout.hxx>
 #include <layout/layout-pre.hxx>
 
+//------------------------------------------------------------------------
+
 class ScStringInputDlg : public ModalDialog
 {
 public:
diff --git a/sc/source/ui/miscdlgs/instbdlg.cxx b/sc/source/ui/miscdlgs/instbdlg.cxx
index 24d8b97..a4ed85e 100644
--- a/sc/source/ui/miscdlgs/instbdlg.cxx
+++ b/sc/source/ui/miscdlgs/instbdlg.cxx
@@ -55,6 +55,17 @@
 #define SC_INSTBDLG_CXX
 #include "instbdlg.hxx"
 
+#include <layout/layout-pre.hxx>
+
+#if ENABLE_LAYOUT
+#undef ScResId
+#define ScResId(x) #x
+#undef ModalDialog
+#define ModalDialog( parent, id ) Dialog( parent, "insert-sheet.xml", id )
+#define ErrorBox( this, bits, message ) ErrorBox (LAYOUT_THIS_WINDOW (this), bits, message)
+#define SetDefDialogParent( this ) SetDefDialogParent (LAYOUT_THIS_WINDOW (this))
+#endif /* ENABLE_LAYOUT */
+
 //==================================================================
 
 ScInsertTableDlg::ScInsertTableDlg( Window* pParent, ScViewData& rData, SCTAB nTabCount, bool bFromFile )
@@ -146,6 +157,10 @@ void ScInsertTableDlg::Init_Impl( bool bFromFile )
 
 //------------------------------------------------------------------------
 
+#if ENABLE_LAYOUT
+#define ModalDialog Dialog
+#endif /* ENABLE_LAYOUT */
+
 short __EXPORT ScInsertTableDlg::Execute()
 {
     // set Parent of DocumentInserter and Doc-Manager
@@ -156,6 +171,7 @@ short __EXPORT ScInsertTableDlg::Execute()
         aBrowseTimer.Start();
 
     short nRet = ModalDialog::Execute();
+#undef SetDefDialogParent
 	Application::SetDefDialogParent( pOldDefParent );
 	return nRet;
 }
diff --git a/sc/uiconfig/layout/insert-sheet.xml b/sc/uiconfig/layout/insert-sheet.xml
new file mode 100644
index 0000000..2d1833b
--- /dev/null
+++ b/sc/uiconfig/layout/insert-sheet.xml
@@ -0,0 +1,28 @@
+<?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" _text="Insert Sheet" xmlns="http://openoffice.org/2007/layout" xmlns:cnt="http://openoffice.org/2007/layout/container">
+    <vbox>
+        <fixedline id="FL_POSITION" _text="Position"/>
+        <okbutton default="true" id="BTN_OK"/>
+        <radiobutton id="RB_BEFORE" tabstop="true" _label="B~efore current sheet"/>
+        <cancelbutton id="BTN_CANCEL"/>
+        <radiobutton id="RB_BEHIND" tabstop="true" _label="~After current sheet"/>
+        <helpbutton id="BTN_HELP"/>
+        <fixedline id="FL_TABLE" _text="Sheet"/>
+        <radiobutton id="RB_NEW" _label="~New sheet"/>
+        <numericfield has_border="true" maximum="256" minimum="1" repeat="true" id="NF_COUNT" spin="true" spin-size="1" tabstop="true"/>
+        <fixedtext id="FT_COUNT" _label="N~o. of sheets"/>
+        <edit has_border="true" id="ED_TABNAME"/>
+        <fixedtext id="FT_NAME" _label="Na~me"/>
+        <radiobutton id="RB_FROMFILE" _label="~From file"/>
+        <hbox>
+            <multilistbox auto-hscroll="true" has_border="true" id="LB_TABLES" simple-mode="true"/>
+            <pushbutton id="BTN_BROWSE" _text="~Browse..."/>
+        </hbox>
+        <checkbox id="CB_LINK" _label="Lin~k"/>
+        <fixedtext id="FT_PATH"/>
+    </vbox>
+</modaldialog>
diff --git a/sc/uiconfig/layout/makefile.mk b/sc/uiconfig/layout/makefile.mk
index 64c8026..7697de3 100644
--- a/sc/uiconfig/layout/makefile.mk
+++ b/sc/uiconfig/layout/makefile.mk
@@ -44,6 +44,7 @@ TARGET=layout
 all: ALLTAR
 
 XML_FILES=\
+  insert-sheet.xml\
   sort-options.xml\
   string-input.xml\
 
-- 
1.5.6.3.317.g5d44c9.dirty


