Kaydet (Commit) db679c57 authored tarafından Caolán McNamara's avatar Caolán McNamara

adapt code to insert sheet .ui

Change-Id: Idba3ff98cecd47743d83ad444151117d5f457a7d
üst 4f8c28de
......@@ -106,7 +106,6 @@ $(eval $(call gb_SrsTarget_add_files,sc/res,\
sc/source/ui/drawfunc/drformsh.src \
sc/source/ui/drawfunc/objdraw.src \
sc/source/ui/miscdlgs/retypepassdlg.src \
sc/source/ui/miscdlgs/instbdlg.src \
sc/source/ui/miscdlgs/highred.src \
sc/source/ui/miscdlgs/conflictsdlg.src \
sc/source/ui/miscdlgs/protectiondlg.src \
......
......@@ -11,6 +11,7 @@ $(eval $(call gb_UI_UI,modules/scalc))
$(eval $(call gb_UI_add_uifiles,modules/scalc,\
sc/uiconfig/scalc/ui/cellprotectionpage \
sc/uiconfig/scalc/ui/insertsheet \
sc/uiconfig/scalc/ui/printeroptions \
sc/uiconfig/scalc/ui/sortcriteriapage \
sc/uiconfig/scalc/ui/sortkey \
......
......@@ -391,8 +391,8 @@ public:
sal_uInt16 nCheckDefaults = 0,
const String* pStrTitle = NULL ) = 0;
virtual AbstractScInsertTableDlg * CreateScInsertTableDlg ( Window* pParent, ScViewData& rViewData, //add for ScInsertTableDlg
SCTAB nTabCount, bool bFromFile, int nId) = 0;
virtual AbstractScInsertTableDlg * CreateScInsertTableDlg(Window* pParent, ScViewData& rViewData,
SCTAB nTabCount, bool bFromFile) = 0;
virtual AbstractScSelEntryDlg * CreateScSelEntryDlg ( Window* pParent, // add for ScSelEntryDlg
sal_uInt16 nResId,
......
......@@ -1002,27 +1002,13 @@ AbstractScInsertContentsDlg * ScAbstractDialogFactory_Impl::CreateScInsertConten
return 0;
}
AbstractScInsertTableDlg * ScAbstractDialogFactory_Impl::CreateScInsertTableDlg ( Window* pParent, ScViewData& rViewData,
SCTAB nTabCount, bool bFromFile, int nId)
AbstractScInsertTableDlg * ScAbstractDialogFactory_Impl::CreateScInsertTableDlg(Window* pParent, ScViewData& rViewData,
SCTAB nTabCount, bool bFromFile)
{
ScInsertTableDlg * pDlg=NULL;
switch ( nId )
{
case RID_SCDLG_INSERT_TABLE :
pDlg = new ScInsertTableDlg( pParent, rViewData,nTabCount, bFromFile );
break;
default:
break;
}
if ( pDlg )
return new AbstractScInsertTableDlg_Impl( pDlg );
return 0;
ScInsertTableDlg* pDlg = new ScInsertTableDlg( pParent, rViewData,nTabCount, bFromFile );
return new AbstractScInsertTableDlg_Impl( pDlg );
}
// add for ScSelEntryDlg begin
AbstractScSelEntryDlg * ScAbstractDialogFactory_Impl::CreateScSelEntryDlg ( Window* pParent,
sal_uInt16 nResId,
......
......@@ -458,8 +458,8 @@ public:
sal_uInt16 nCheckDefaults = 0,
const String* pStrTitle = NULL );
virtual AbstractScInsertTableDlg * CreateScInsertTableDlg ( Window* pParent, ScViewData& rViewData, //add for ScInsertTableDlg
SCTAB nTabCount, bool bFromFile, int nId);
virtual AbstractScInsertTableDlg * CreateScInsertTableDlg(Window* pParent, ScViewData& rViewData,
SCTAB nTabCount, bool bFromFile);
virtual AbstractScSelEntryDlg * CreateScSelEntryDlg ( Window* pParent, // add for ScSelEntryDlg
sal_uInt16 nResId,
......
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <sc.hrc> // -> RID_SCDLG_INSERT_TABLE
#define BTN_OK 1
#define BTN_CANCEL 2
#define BTN_HELP 3
#define FL_POSITION 10
#define RB_BEFORE 11
#define RB_BEHIND 12
#define FL_TABLE 20
#define RB_NEW 21
#define FT_COUNT 22
#define NF_COUNT 23
#define FT_NAME 24
#define ED_TABNAME 25
#define RB_FROMFILE 26
#define LB_TABLES 27
#define BTN_BROWSE 28
#define CB_LINK 29
#define FT_PATH 30
......@@ -50,33 +50,29 @@ public:
virtual short Execute(); // overloaded to set parent dialog
sal_Bool GetTablesFromFile() { return aBtnFromFile.IsChecked(); }
sal_Bool GetTablesAsLink() { return aBtnLink.IsChecked(); }
sal_Bool GetTablesFromFile() const { return m_pBtnFromFile->IsChecked(); }
sal_Bool GetTablesAsLink() const { return m_pBtnLink->IsChecked(); }
const String* GetFirstTable( sal_uInt16* pN = NULL );
const String* GetNextTable( sal_uInt16* pN = NULL );
ScDocShell* GetDocShellTables() { return pDocShTables; }
sal_Bool IsTableBefore() { return aBtnBefore.IsChecked(); }
SCTAB GetTableCount() { return nTableCount;}
sal_Bool IsTableBefore() const { return m_pBtnBefore->IsChecked(); }
SCTAB GetTableCount() const { return nTableCount;}
private:
FixedLine aFlPos;
RadioButton aBtnBefore;
RadioButton aBtnBehind;
FixedLine aFlTable;
RadioButton aBtnNew;
RadioButton aBtnFromFile;
FixedText aFtCount;
NumericField aNfCount;
FixedText aFtName;
Edit aEdName;
MultiListBox aLbTables;
ScExpandedFixedText aFtPath;
PushButton aBtnBrowse;
CheckBox aBtnLink;
OKButton aBtnOk;
CancelButton aBtnCancel;
HelpButton aBtnHelp;
RadioButton* m_pBtnBefore;
RadioButton* m_pBtnBehind;
RadioButton* m_pBtnNew;
RadioButton* m_pBtnFromFile;
FixedText* m_pFtCount;
NumericField* m_pNfCount;
FixedText* m_pFtName;
Edit* m_pEdName;
ListBox* m_pLbTables;
FixedText* m_pFtPath;
PushButton* m_pBtnBrowse;
CheckBox* m_pBtnLink;
OKButton* m_pBtnOk;
Timer aBrowseTimer;
ScViewData& rViewData;
......@@ -86,9 +82,10 @@ private:
SfxObjectShellRef aDocShTablesRef;
bool bMustClose;
sal_uInt16 nSelTabIndex; // for GetFirstTable() / GetNextTable()
sal_uInt16 nSelTabIndex; // for GetFirstTable() / GetNextTable()
String aStrCurSelTable;
SCTAB nTableCount;
OUString m_sSheetDotDotDot;
#ifdef SC_INSTBDLG_CXX
void Init_Impl( bool bFromFile );
......
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "instbdlg.hrc"
ModalDialog RID_SCDLG_INSERT_TABLE
{
HelpID = "sc:ModalDialog:RID_SCDLG_INSERT_TABLE";
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 274 , 190 ) ;
Text [ en-US ] = "Insert Sheet" ;
Moveable = TRUE ;
Closeable = TRUE ;
OKButton BTN_OK
{
Pos = MAP_APPFONT ( 218 , 6 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
DefButton = TRUE ;
};
CancelButton BTN_CANCEL
{
Pos = MAP_APPFONT ( 218 , 23 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
};
HelpButton BTN_HELP
{
Pos = MAP_APPFONT ( 218 , 43 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
};
FixedLine FL_POSITION
{
Pos = MAP_APPFONT ( 6 , 3 ) ;
Size = MAP_APPFONT ( 206 , 8 ) ;
Text [ en-US ] = "Position" ;
};
RadioButton RB_BEFORE
{
HelpID = "sc:RadioButton:RID_SCDLG_INSERT_TABLE:RB_BEFORE";
Pos = MAP_APPFONT ( 12 , 14 ) ;
Size = MAP_APPFONT ( 197 , 10 ) ;
TabStop = TRUE ;
Text [ en-US ] = "B~efore current sheet" ;
};
RadioButton RB_BEHIND
{
HelpID = "sc:RadioButton:RID_SCDLG_INSERT_TABLE:RB_BEHIND";
Pos = MAP_APPFONT ( 12 , 28 ) ;
Size = MAP_APPFONT ( 197 , 10 ) ;
TabStop = TRUE ;
Text [ en-US ] = "~After current sheet" ;
};
FixedLine FL_TABLE
{
Pos = MAP_APPFONT ( 6 , 44 ) ;
Size = MAP_APPFONT ( 206 , 8 ) ;
Text [ en-US ] = "Sheet" ;
};
RadioButton RB_NEW
{
HelpID = "sc:RadioButton:RID_SCDLG_INSERT_TABLE:RB_NEW";
Pos = MAP_APPFONT ( 12 , 55 ) ;
Size = MAP_APPFONT ( 197 , 10 ) ;
Text [ en-US ] = "~New sheet" ;
};
FixedText FT_COUNT
{
Pos = MAP_APPFONT ( 20 , 68 ) ;
Size = MAP_APPFONT ( 52 , 8 ) ;
Text [ en-US ] = "N~o. of sheets" ;
};
NumericField NF_COUNT
{
HelpID = "sc:NumericField:RID_SCDLG_INSERT_TABLE:NF_COUNT";
Border = TRUE ;
Pos = MAP_APPFONT ( 72 , 66 ) ;
Size = MAP_APPFONT ( 30 , 12 ) ;
TabStop = TRUE ;
Spin = TRUE ;
SpinSize = 1 ;
Repeat = TRUE ;
Minimum = 1 ;
Maximum = 256 ;
};
FixedText FT_NAME
{
Pos = MAP_APPFONT ( 20 , 84 ) ;
Size = MAP_APPFONT ( 50 , 8 ) ;
Text [ en-US ] = "Na~me";
};
Edit ED_TABNAME
{
HelpID = "sc:Edit:RID_SCDLG_INSERT_TABLE:ED_TABNAME";
Border = TRUE ;
Pos = MAP_APPFONT ( 72 , 82 ) ;
Size = MAP_APPFONT ( 137 , 12 ) ;
};
RadioButton RB_FROMFILE
{
HelpID = "sc:RadioButton:RID_SCDLG_INSERT_TABLE:RB_FROMFILE";
Pos = MAP_APPFONT ( 12 , 100 ) ;
Size = MAP_APPFONT ( 197 , 10 ) ;
Text [ en-US ] = "~From file" ;
};
MultiListBox LB_TABLES
{
HelpID = "sc:MultiListBox:RID_SCDLG_INSERT_TABLE:LB_TABLES";
SimpleMode = TRUE ;
Border = TRUE ;
Pos = MAP_APPFONT ( 20 , 113 ) ;
Size = MAP_APPFONT ( 123 , 59 ) ;
AutoHScroll = TRUE ;
};
PushButton BTN_BROWSE
{
HelpID = "sc:PushButton:RID_SCDLG_INSERT_TABLE:BTN_BROWSE";
Pos = MAP_APPFONT ( 149 , 113 ) ;
Size = MAP_APPFONT ( 60 , 14 ) ;
Text [ en-US ] = "~Browse..." ;
};
CheckBox CB_LINK
{
HelpID = "sc:CheckBox:RID_SCDLG_INSERT_TABLE:CB_LINK";
Pos = MAP_APPFONT ( 149 , 131 ) ;
Size = MAP_APPFONT ( 60 , 10 ) ;
Text [ en-US ] = "Lin~k" ;
};
FixedText FT_PATH
{
Pos = MAP_APPFONT ( 20 , 176 ) ;
Size = MAP_APPFONT ( 192 , 8 ) ;
};
};
......@@ -221,9 +221,8 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
AbstractScInsertTableDlg* pDlg = pFact->CreateScInsertTableDlg( GetDialogParent(), *pViewData,
nTabSelCount, nSlot == FID_INS_TABLE_EXT,
RID_SCDLG_INSERT_TABLE);
AbstractScInsertTableDlg* pDlg = pFact->CreateScInsertTableDlg(GetDialogParent(), *pViewData,
nTabSelCount, nSlot == FID_INS_TABLE_EXT);
OSL_ENSURE(pDlg, "Dialog create fail!");
if ( RET_OK == pDlg->Execute() )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment