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

convert import options dialog to .ui

Change-Id: Iaf20b6d2306ba76f21cb5f7be231f40b403c790a
üst 25dbaef6
...@@ -201,7 +201,16 @@ ...@@ -201,7 +201,16 @@
<glade-widget-class title="Text Encoding ListBox" name="svxlo-SvxTextEncodingBox" <glade-widget-class title="Text Encoding ListBox" name="svxlo-SvxTextEncodingBox"
generic-name="TextEncodingBox" parent="GtkComboBox" generic-name="TextEncodingBox" parent="GtkComboBox"
icon-name="widget-gtk-combobox"/> icon-name="widget-gtk-combobox">
<properties>
<property save="True" query="False" id="dropdown" default="True" name="Use DropDown">
<parameter-spec>
<type>GParamBoolean</type>
</parameter-spec>
</property>
</properties>
</glade-widget-class>
<glade-widget-class title="Limit ListBox" name="dbulo-LimitBox" <glade-widget-class title="Limit ListBox" name="dbulo-LimitBox"
generic-name="LimitBox" parent="GtkComboBox" generic-name="LimitBox" parent="GtkComboBox"
icon-name="widget-gtk-combobox"/> icon-name="widget-gtk-combobox"/>
......
...@@ -53,7 +53,6 @@ $(eval $(call gb_SrsTarget_add_files,sc/res,\ ...@@ -53,7 +53,6 @@ $(eval $(call gb_SrsTarget_add_files,sc/res,\
sc/source/ui/dbgui/dpgroupdlg.src \ sc/source/ui/dbgui/dpgroupdlg.src \
sc/source/ui/dbgui/pvfundlg.src \ sc/source/ui/dbgui/pvfundlg.src \
sc/source/ui/dbgui/dapitype.src \ sc/source/ui/dbgui/dapitype.src \
sc/source/ui/dbgui/imoptdlg.src \
sc/source/ui/dbgui/scendlg.src \ sc/source/ui/dbgui/scendlg.src \
sc/source/ui/dbgui/validate.src \ sc/source/ui/dbgui/validate.src \
sc/source/ui/drawfunc/drformsh.src \ sc/source/ui/drawfunc/drformsh.src \
......
...@@ -94,6 +94,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\ ...@@ -94,6 +94,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
sc/uiconfig/scalc/ui/headerdialog \ sc/uiconfig/scalc/ui/headerdialog \
sc/uiconfig/scalc/ui/headerfootercontent \ sc/uiconfig/scalc/ui/headerfootercontent \
sc/uiconfig/scalc/ui/headerfooterdialog \ sc/uiconfig/scalc/ui/headerfooterdialog \
sc/uiconfig/scalc/ui/imoptdialog \
sc/uiconfig/scalc/ui/inputstringdialog \ sc/uiconfig/scalc/ui/inputstringdialog \
sc/uiconfig/scalc/ui/insertcells \ sc/uiconfig/scalc/ui/insertcells \
sc/uiconfig/scalc/ui/insertname \ sc/uiconfig/scalc/ui/insertname \
......
...@@ -52,7 +52,6 @@ ...@@ -52,7 +52,6 @@
// Hilfe IDs fuer Dialoge / Pages (max.70) ----------------------------------- // Hilfe IDs fuer Dialoge / Pages (max.70) -----------------------------------
#define HID_SC_PIVOTFILTER "SC_HID_SC_PIVOTFILTER" #define HID_SC_PIVOTFILTER "SC_HID_SC_PIVOTFILTER"
#define HID_SC_INPORTOPT "SC_HID_SC_INPORTOPT"
#define HID_SC_NAVIGATOR "SC_HID_SC_NAVIGATOR" #define HID_SC_NAVIGATOR "SC_HID_SC_NAVIGATOR"
......
...@@ -1029,7 +1029,6 @@ ...@@ -1029,7 +1029,6 @@
#define RID_SCPAGE_CALC (SC_DIALOGS_START + 56) #define RID_SCPAGE_CALC (SC_DIALOGS_START + 56)
#define RID_SCDLG_NAVIGATOR (SC_DIALOGS_START + 57) #define RID_SCDLG_NAVIGATOR (SC_DIALOGS_START + 57)
#define RID_SCDLG_IMPORTOPT (SC_DIALOGS_START + 59)
#define RID_POPUP_ROWHEADER (SC_DIALOGS_START + 60) #define RID_POPUP_ROWHEADER (SC_DIALOGS_START + 60)
#define RID_POPUP_COLHEADER (SC_DIALOGS_START + 61) #define RID_POPUP_COLHEADER (SC_DIALOGS_START + 61)
#define RID_SCDLG_HFEDIT_SHDR (SC_DIALOGS_START + 62) #define RID_SCDLG_HFEDIT_SHDR (SC_DIALOGS_START + 62)
......
...@@ -459,7 +459,6 @@ public: ...@@ -459,7 +459,6 @@ public:
const OString& ) = 0; const OString& ) = 0;
virtual AbstractScImportOptionsDlg * CreateScImportOptionsDlg ( Window* pParent, virtual AbstractScImportOptionsDlg * CreateScImportOptionsDlg ( Window* pParent,
int nId,
sal_Bool bAscii = sal_True, sal_Bool bAscii = sal_True,
const ScImportOptions* pOptions = NULL, const ScImportOptions* pOptions = NULL,
const OUString* pStrTitle = NULL, const OUString* pStrTitle = NULL,
......
...@@ -960,7 +960,6 @@ AbstractScTabBgColorDlg * ScAbstractDialogFactory_Impl::CreateScTabBgColorDlg( ...@@ -960,7 +960,6 @@ AbstractScTabBgColorDlg * ScAbstractDialogFactory_Impl::CreateScTabBgColorDlg(
} }
AbstractScImportOptionsDlg * ScAbstractDialogFactory_Impl::CreateScImportOptionsDlg ( Window* pParent, AbstractScImportOptionsDlg * ScAbstractDialogFactory_Impl::CreateScImportOptionsDlg ( Window* pParent,
int nId,
sal_Bool bAscii, sal_Bool bAscii,
const ScImportOptions* pOptions, const ScImportOptions* pOptions,
const OUString* pStrTitle, const OUString* pStrTitle,
...@@ -968,19 +967,8 @@ AbstractScImportOptionsDlg * ScAbstractDialogFactory_Impl::CreateScImportOptions ...@@ -968,19 +967,8 @@ AbstractScImportOptionsDlg * ScAbstractDialogFactory_Impl::CreateScImportOptions
sal_Bool bOnlyDbtoolsEncodings, sal_Bool bOnlyDbtoolsEncodings,
sal_Bool bImport ) sal_Bool bImport )
{ {
ScImportOptionsDlg * pDlg=NULL; ScImportOptionsDlg * pDlg = new ScImportOptionsDlg( pParent, bAscii, pOptions,pStrTitle, bMultiByte,bOnlyDbtoolsEncodings, bImport );
switch ( nId ) return new AbstractScImportOptionsDlg_Impl( pDlg );
{
case RID_SCDLG_IMPORTOPT :
pDlg = new ScImportOptionsDlg( pParent, bAscii, pOptions,pStrTitle, bMultiByte,bOnlyDbtoolsEncodings, bImport );
break;
default:
break;
}
if ( pDlg )
return new AbstractScImportOptionsDlg_Impl( pDlg );
return 0;
} }
SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScAttrDlg(SfxViewFrame* pFrame, SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScAttrDlg(SfxViewFrame* pFrame,
......
...@@ -528,7 +528,6 @@ public: ...@@ -528,7 +528,6 @@ public:
const OString& sHelpId ); const OString& sHelpId );
virtual AbstractScImportOptionsDlg * CreateScImportOptionsDlg ( Window* pParent, virtual AbstractScImportOptionsDlg * CreateScImportOptionsDlg ( Window* pParent,
int nId,
sal_Bool bAscii = sal_True, sal_Bool bAscii = sal_True,
const ScImportOptions* pOptions = NULL, const ScImportOptions* pOptions = NULL,
const OUString* pStrTitle = NULL, const OUString* pStrTitle = NULL,
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include "imoptdlg.hxx" #include "imoptdlg.hxx"
#include "asciiopt.hxx" #include "asciiopt.hxx"
#include "scresid.hxx" #include "scresid.hxx"
#include "imoptdlg.hrc"
#include <comphelper/string.hxx> #include <comphelper/string.hxx>
#include <osl/thread.h> #include <osl/thread.h>
#include <rtl/tencinfo.h> #include <rtl/tencinfo.h>
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "sc.hrc"
#define BTN_OK 1
#define BTN_CANCEL 2
#define BTN_HELP 3
#define FT_FIELDSEP 4
#define ED_FIELDSEP 5
#define FT_TEXTSEP 6
#define ED_TEXTSEP 7
#define FT_FONT 8
#define DDLB_FONT 9
#define LB_FONT 10
#define FL_FIELDOPT 11
#define CB_FIXEDWIDTH 12
#define CB_SAVESHOWN 13
#define CB_QUOTEALL 14
#define CB_FORMULAS 15
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "imoptdlg.hrc"
ModalDialog RID_SCDLG_IMPORTOPT
{
HelpId = HID_SC_INPORTOPT ;
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 256 , 66 ) ;
Moveable = TRUE ;
Closeable = FALSE ;
Text [ en-US ] = "Import File" ;
FixedText FT_FIELDSEP
{
Pos = MAP_APPFONT ( 12 , 32 ) ;
Size = MAP_APPFONT ( 55 , 8 ) ;
Text [ en-US ] = "~Field delimiter" ;
};
ComboBox ED_FIELDSEP
{
HelpID = "sc:ComboBox:RID_SCDLG_IMPORTOPT:ED_FIELDSEP";
Pos = MAP_APPFONT ( 70 , 30 ) ;
Size = MAP_APPFONT ( 121 , 60 ) ;
DropDown = TRUE ;
};
FixedText FT_TEXTSEP
{
Pos = MAP_APPFONT ( 12 , 48 ) ;
Size = MAP_APPFONT ( 55 , 8 ) ;
Text [ en-US ] = "~Text delimiter" ;
};
ComboBox ED_TEXTSEP
{
HelpID = "sc:ComboBox:RID_SCDLG_IMPORTOPT:ED_TEXTSEP";
Pos = MAP_APPFONT ( 70 , 46 ) ;
Size = MAP_APPFONT ( 121 , 60 ) ;
DropDown = TRUE ;
};
FixedText FT_FONT
{
Pos = MAP_APPFONT ( 12 , 16 ) ;
Size = MAP_APPFONT ( 55 , 8 ) ;
Text [ en-US ] = "~Character set" ;
};
ListBox DDLB_FONT
{
HelpID = "sc:ListBox:RID_SCDLG_IMPORTOPT:DDLB_FONT";
Border = TRUE;
Sort = TRUE;
DropDown = TRUE ;
Pos = MAP_APPFONT ( 70 , 14 ) ;
Size = MAP_APPFONT ( 121 , 52 ) ;
};
ListBox LB_FONT
{
HelpID = "sc:ListBox:RID_SCDLG_IMPORTOPT:LB_FONT";
Border = TRUE;
Sort = TRUE;
DropDown = FALSE ;
Pos = MAP_APPFONT ( 12 , 14 ) ;
Size = MAP_APPFONT ( 179 , 50 ) ;
};
FixedLine FL_FIELDOPT
{
Pos = MAP_APPFONT ( 6 , 3 ) ;
Size = MAP_APPFONT ( 188 , 8 ) ;
Text [ en-US ] = "Field options" ;
};
CheckBox CB_SAVESHOWN
{
HelpID = "sc:CheckBox:RID_SCDLG_IMPORTOPT:CB_SAVESHOWN";
Pos = MAP_APPFONT( 12, 66 );
Size = MAP_APPFONT( 172, 10 );
Hide = TRUE;
Text [ en-US ] = "Save cell content as ~shown";
};
CheckBox CB_FORMULAS
{
HelpID = "sc:CheckBox:RID_SCDLG_IMPORTOPT:CB_FORMULAS";
Pos = MAP_APPFONT( 12, 79 );
Size = MAP_APPFONT( 172, 10 );
Hide = TRUE;
Text [ en-US ] = "Save cell fo~rmulas instead of calculated values";
};
CheckBox CB_QUOTEALL
{
HelpID = "sc:CheckBox:RID_SCDLG_IMPORTOPT:CB_QUOTEALL";
Pos = MAP_APPFONT( 12, 92 );
Size = MAP_APPFONT( 172, 10 );
Hide = TRUE;
Text [ en-US ] = "~Quote all text cells";
};
CheckBox CB_FIXEDWIDTH
{
HelpID = "sc:CheckBox:RID_SCDLG_IMPORTOPT:CB_FIXEDWIDTH";
Pos = MAP_APPFONT( 12, 105 );
Size = MAP_APPFONT( 172, 10 );
Hide = TRUE;
Text [ en-US ] = "Fixed column ~width";
};
OKButton BTN_OK
{
Pos = MAP_APPFONT ( 202 , 6 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
DefButton = TRUE ;
};
CancelButton BTN_CANCEL
{
Pos = MAP_APPFONT ( 202 , 24 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
};
HelpButton BTN_HELP
{
Pos = MAP_APPFONT ( 202 , 43 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
};
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include "scuiimoptdlg.hxx" #include "scuiimoptdlg.hxx"
#include "tabvwsh.hxx" #include "tabvwsh.hxx"
#include "scresid.hxx" #include "scresid.hxx"
#include "imoptdlg.hrc" #include "sc.hrc"
#include <comphelper/string.hxx> #include <comphelper/string.hxx>
#include <osl/thread.h> #include <osl/thread.h>
#include <rtl/tencinfo.h> #include <rtl/tencinfo.h>
...@@ -117,23 +117,29 @@ ScImportOptionsDlg::ScImportOptionsDlg( ...@@ -117,23 +117,29 @@ ScImportOptionsDlg::ScImportOptionsDlg(
sal_Bool bMultiByte, sal_Bool bMultiByte,
sal_Bool bOnlyDbtoolsEncodings, sal_Bool bOnlyDbtoolsEncodings,
sal_Bool bImport ) sal_Bool bImport )
: ModalDialog ( pParent, "ImOptDialog",
: ModalDialog ( pParent, ScResId( RID_SCDLG_IMPORTOPT ) ), "modules/scalc/ui/imoptdialog.ui" )
aFlFieldOpt ( this, ScResId( FL_FIELDOPT ) ),
aFtFont ( this, ScResId( FT_FONT ) ),
aLbFont ( this, ScResId( bAscii ? DDLB_FONT : LB_FONT ) ),
aFtFieldSep ( this, ScResId( FT_FIELDSEP ) ),
aEdFieldSep ( this, ScResId( ED_FIELDSEP ) ),
aFtTextSep ( this, ScResId( FT_TEXTSEP ) ),
aEdTextSep ( this, ScResId( ED_TEXTSEP ) ),
aCbShown ( this, ScResId( CB_SAVESHOWN ) ),
aCbFormulas ( this, ScResId( CB_FORMULAS ) ),
aCbQuoteAll ( this, ScResId( CB_QUOTEALL ) ),
aCbFixed ( this, ScResId( CB_FIXEDWIDTH ) ),
aBtnOk ( this, ScResId( BTN_OK ) ),
aBtnCancel ( this, ScResId( BTN_CANCEL ) ),
aBtnHelp ( this, ScResId( BTN_HELP ) )
{ {
get(m_pFieldFrame, "fieldframe");
get(m_pFtCharset, "charsetft");
if (bAscii)
get(m_pLbCharset, "charsetdropdown");
else
{
get(m_pLbCharset, "charsetlist");
m_pLbCharset->set_height_request(6 * m_pLbCharset->GetTextHeight());
}
m_pLbCharset->Show();
get(m_pFtFieldSep, "fieldft");
get(m_pEdFieldSep, "field");
get(m_pFtTextSep, "textft");
get(m_pEdTextSep, "text");
get(m_pCbShown, "asshown");
get(m_pCbFormulas, "formulas");
get(m_pCbQuoteAll, "quoteall");
get(m_pCbFixed, "fixedwidth");
get(m_pBtnOk, "ok");
OUString sFieldSep(SC_RESSTR(SCSTR_FIELDSEP)); OUString sFieldSep(SC_RESSTR(SCSTR_FIELDSEP));
sFieldSep = sFieldSep.replaceFirst( "%TAB", SC_RESSTR(SCSTR_FIELDSEP_TAB) ); sFieldSep = sFieldSep.replaceFirst( "%TAB", SC_RESSTR(SCSTR_FIELDSEP_TAB) );
sFieldSep = sFieldSep.replaceFirst( "%SPACE", SC_RESSTR(SCSTR_FIELDSEP_SPACE) ); sFieldSep = sFieldSep.replaceFirst( "%SPACE", SC_RESSTR(SCSTR_FIELDSEP_SPACE) );
...@@ -147,7 +153,7 @@ ScImportOptionsDlg::ScImportOptionsDlg( ...@@ -147,7 +153,7 @@ ScImportOptionsDlg::ScImportOptionsDlg(
while ( !aStr.isEmpty() ) while ( !aStr.isEmpty() )
{ {
aEdFieldSep.InsertEntry( aStr ); m_pEdFieldSep->InsertEntry( aStr );
aStr = pFieldSepTab->NextDel(); aStr = pFieldSepTab->NextDel();
} }
...@@ -155,27 +161,27 @@ ScImportOptionsDlg::ScImportOptionsDlg( ...@@ -155,27 +161,27 @@ ScImportOptionsDlg::ScImportOptionsDlg(
while ( !aStr.isEmpty() ) while ( !aStr.isEmpty() )
{ {
aEdTextSep.InsertEntry( aStr ); m_pEdTextSep->InsertEntry( aStr );
aStr = pTextSepTab->NextDel(); aStr = pTextSepTab->NextDel();
} }
aEdFieldSep.SetText( aEdFieldSep.GetEntry(0) ); m_pEdFieldSep->SetText( m_pEdFieldSep->GetEntry(0) );
aEdTextSep.SetText( aEdTextSep.GetEntry(0) ); m_pEdTextSep->SetText( m_pEdTextSep->GetEntry(0) );
if ( bOnlyDbtoolsEncodings ) if ( bOnlyDbtoolsEncodings )
{ {
// Even dBase export allows multibyte now // Even dBase export allows multibyte now
if ( bMultiByte ) if ( bMultiByte )
aLbFont.FillFromDbTextEncodingMap( bImport ); m_pLbCharset->FillFromDbTextEncodingMap( bImport );
else else
aLbFont.FillFromDbTextEncodingMap( bImport, RTL_TEXTENCODING_INFO_MULTIBYTE ); m_pLbCharset->FillFromDbTextEncodingMap( bImport, RTL_TEXTENCODING_INFO_MULTIBYTE );
} }
else if ( !bAscii ) else if ( !bAscii )
{ //!TODO: Unicode would need work in each filter { //!TODO: Unicode would need work in each filter
if ( bMultiByte ) if ( bMultiByte )
aLbFont.FillFromTextEncodingTable( bImport, RTL_TEXTENCODING_INFO_UNICODE ); m_pLbCharset->FillFromTextEncodingTable( bImport, RTL_TEXTENCODING_INFO_UNICODE );
else else
aLbFont.FillFromTextEncodingTable( bImport, RTL_TEXTENCODING_INFO_UNICODE | m_pLbCharset->FillFromTextEncodingTable( bImport, RTL_TEXTENCODING_INFO_UNICODE |
RTL_TEXTENCODING_INFO_MULTIBYTE ); RTL_TEXTENCODING_INFO_MULTIBYTE );
} }
else else
...@@ -186,67 +192,60 @@ ScImportOptionsDlg::ScImportOptionsDlg( ...@@ -186,67 +192,60 @@ ScImportOptionsDlg::ScImportOptionsDlg(
aStr = pFieldSepTab->GetDelimiter( nCode ); aStr = pFieldSepTab->GetDelimiter( nCode );
if ( aStr.isEmpty() ) if ( aStr.isEmpty() )
aEdFieldSep.SetText( OUString((sal_Unicode)nCode) ); m_pEdFieldSep->SetText( OUString((sal_Unicode)nCode) );
else else
aEdFieldSep.SetText( aStr ); m_pEdFieldSep->SetText( aStr );
nCode = pOptions->nTextSepCode; nCode = pOptions->nTextSepCode;
aStr = pTextSepTab->GetDelimiter( nCode ); aStr = pTextSepTab->GetDelimiter( nCode );
if ( aStr.isEmpty() ) if ( aStr.isEmpty() )
aEdTextSep.SetText( OUString((sal_Unicode)nCode) ); m_pEdTextSep->SetText( OUString((sal_Unicode)nCode) );
else else
aEdTextSep.SetText( aStr ); m_pEdTextSep->SetText( aStr );
} }
// all encodings allowed, even Unicode // all encodings allowed, even Unicode
aLbFont.FillFromTextEncodingTable( bImport ); m_pLbCharset->FillFromTextEncodingTable( bImport );
} }
if( bAscii ) if( bAscii )
{ {
Size aWinSize( GetSizePixel() ); m_pCbFixed->Show();
aWinSize.Height() = aCbFixed.GetPosPixel().Y() + aCbFixed.GetSizePixel().Height(); m_pCbFixed->SetClickHdl( LINK( this, ScImportOptionsDlg, FixedWidthHdl ) );
Size aDiffSize( LogicToPixel( Size( 0, 6 ), MapMode( MAP_APPFONT ) ) ); m_pCbFixed->Check( false );
aWinSize.Height() += aDiffSize.Height(); m_pCbShown->Show();
SetSizePixel( aWinSize ); m_pCbShown->Check( sal_True );
aCbFixed.Show(); m_pCbQuoteAll->Show();
aCbFixed.SetClickHdl( LINK( this, ScImportOptionsDlg, FixedWidthHdl ) ); m_pCbQuoteAll->Check( false );
aCbFixed.Check( false ); m_pCbFormulas->Show();
aCbShown.Show();
aCbShown.Check( sal_True );
aCbQuoteAll.Show();
aCbQuoteAll.Check( false );
aCbFormulas.Show();
ScTabViewShell* pViewSh = PTR_CAST( ScTabViewShell, SfxViewShell::Current()); ScTabViewShell* pViewSh = PTR_CAST( ScTabViewShell, SfxViewShell::Current());
bool bFormulas = (pViewSh ? bool bFormulas = (pViewSh ?
pViewSh->GetViewData()->GetOptions().GetOption( VOPT_FORMULAS) : pViewSh->GetViewData()->GetOptions().GetOption( VOPT_FORMULAS) :
false); false);
aCbFormulas.Check( bFormulas ); m_pCbFormulas->Check( bFormulas );
} }
else else
{ {
aFlFieldOpt.SetText( aFtFont.GetText() ); m_pFieldFrame->set_label(m_pFtCharset->GetText());
aFtFieldSep.Hide(); m_pFtFieldSep->Hide();
aFtTextSep.Hide(); m_pFtTextSep->Hide();
aFtFont.Hide(); m_pFtCharset->Hide();
aEdFieldSep.Hide(); m_pEdFieldSep->Hide();
aEdTextSep.Hide(); m_pEdTextSep->Hide();
aCbFixed.Hide(); m_pCbFixed->Hide();
aCbShown.Hide(); m_pCbShown->Hide();
aCbQuoteAll.Hide(); m_pCbQuoteAll->Hide();
aCbFormulas.Hide(); m_pCbFormulas->Hide();
aLbFont.GrabFocus(); m_pLbCharset->GrabFocus();
aLbFont.SetDoubleClickHdl( LINK( this, ScImportOptionsDlg, DoubleClickHdl ) ); m_pLbCharset->SetDoubleClickHdl( LINK( this, ScImportOptionsDlg, DoubleClickHdl ) );
} }
aLbFont.SelectTextEncoding( pOptions ? pOptions->eCharSet : m_pLbCharset->SelectTextEncoding( pOptions ? pOptions->eCharSet :
osl_getThreadTextEncoding() ); osl_getThreadTextEncoding() );
// optionaler Titel: // optionaler Titel:
if ( pStrTitle ) if ( pStrTitle )
SetText( *pStrTitle ); SetText( *pStrTitle );
FreeResource();
} }
//------------------------------------------------------------------------ //------------------------------------------------------------------------
...@@ -261,16 +260,16 @@ ScImportOptionsDlg::~ScImportOptionsDlg() ...@@ -261,16 +260,16 @@ ScImportOptionsDlg::~ScImportOptionsDlg()
void ScImportOptionsDlg::GetImportOptions( ScImportOptions& rOptions ) const void ScImportOptionsDlg::GetImportOptions( ScImportOptions& rOptions ) const
{ {
rOptions.SetTextEncoding( aLbFont.GetSelectTextEncoding() ); rOptions.SetTextEncoding( m_pLbCharset->GetSelectTextEncoding() );
if ( aCbFixed.IsVisible() ) if ( m_pCbFixed->IsVisible() )
{ {
rOptions.nFieldSepCode = GetCodeFromCombo( aEdFieldSep ); rOptions.nFieldSepCode = GetCodeFromCombo( *m_pEdFieldSep );
rOptions.nTextSepCode = GetCodeFromCombo( aEdTextSep ); rOptions.nTextSepCode = GetCodeFromCombo( *m_pEdTextSep );
rOptions.bFixedWidth = aCbFixed.IsChecked(); rOptions.bFixedWidth = m_pCbFixed->IsChecked();
rOptions.bSaveAsShown = aCbShown.IsChecked(); rOptions.bSaveAsShown = m_pCbShown->IsChecked();
rOptions.bQuoteAllText = aCbQuoteAll.IsChecked(); rOptions.bQuoteAllText = m_pCbQuoteAll->IsChecked();
rOptions.bSaveFormulas = aCbFormulas.IsChecked(); rOptions.bSaveFormulas = m_pCbFormulas->IsChecked();
} }
} }
...@@ -282,7 +281,7 @@ sal_uInt16 ScImportOptionsDlg::GetCodeFromCombo( const ComboBox& rEd ) const ...@@ -282,7 +281,7 @@ sal_uInt16 ScImportOptionsDlg::GetCodeFromCombo( const ComboBox& rEd ) const
OUString aStr( rEd.GetText() ); OUString aStr( rEd.GetText() );
sal_uInt16 nCode; sal_uInt16 nCode;
if ( &rEd == &aEdTextSep ) if ( &rEd == m_pEdTextSep )
pTab = pTextSepTab; pTab = pTextSepTab;
else else
pTab = pFieldSepTab; pTab = pFieldSepTab;
...@@ -306,24 +305,24 @@ sal_uInt16 ScImportOptionsDlg::GetCodeFromCombo( const ComboBox& rEd ) const ...@@ -306,24 +305,24 @@ sal_uInt16 ScImportOptionsDlg::GetCodeFromCombo( const ComboBox& rEd ) const
IMPL_LINK( ScImportOptionsDlg, FixedWidthHdl, CheckBox*, pCheckBox ) IMPL_LINK( ScImportOptionsDlg, FixedWidthHdl, CheckBox*, pCheckBox )
{ {
if( pCheckBox == &aCbFixed ) if (pCheckBox == m_pCbFixed)
{ {
sal_Bool bEnable = !aCbFixed.IsChecked(); sal_Bool bEnable = !m_pCbFixed->IsChecked();
aFtFieldSep.Enable( bEnable ); m_pFtFieldSep->Enable( bEnable );
aEdFieldSep.Enable( bEnable ); m_pEdFieldSep->Enable( bEnable );
aFtTextSep.Enable( bEnable ); m_pFtTextSep->Enable( bEnable );
aEdTextSep.Enable( bEnable ); m_pEdTextSep->Enable( bEnable );
aCbShown.Enable( bEnable ); m_pCbShown->Enable( bEnable );
aCbQuoteAll.Enable( bEnable ); m_pCbQuoteAll->Enable( bEnable );
} }
return 0; return 0;
} }
IMPL_LINK( ScImportOptionsDlg, DoubleClickHdl, ListBox*, pLb ) IMPL_LINK( ScImportOptionsDlg, DoubleClickHdl, ListBox*, pLb )
{ {
if ( pLb == &aLbFont ) if (pLb == m_pLbCharset)
{ {
aBtnOk.Click(); m_pBtnOk->Click();
} }
return 0; return 0;
} }
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#ifndef SCUI_IMOPTDLG_HXX #ifndef SCUI_IMOPTDLG_HXX
#define SCUI_IMOPTDLG_HXX #define SCUI_IMOPTDLG_HXX
#include <vcl/layout.hxx>
#include "imoptdlg.hxx" #include "imoptdlg.hxx"
//=================================================================== //===================================================================
...@@ -30,33 +31,31 @@ class ScDelimiterTable; ...@@ -30,33 +31,31 @@ class ScDelimiterTable;
class ScImportOptionsDlg : public ModalDialog class ScImportOptionsDlg : public ModalDialog
{ {
public: public:
ScImportOptionsDlg( Window* pParent, ScImportOptionsDlg( Window* pParent,
sal_Bool bAscii = sal_True, sal_Bool bAscii = sal_True,
const ScImportOptions* pOptions = NULL, const ScImportOptions* pOptions = NULL,
const OUString* pStrTitle = NULL, const OUString* pStrTitle = NULL,
sal_Bool bMultiByte = false, sal_Bool bMultiByte = false,
sal_Bool bOnlyDbtoolsEncodings = false, sal_Bool bOnlyDbtoolsEncodings = false,
sal_Bool bImport = sal_True ); sal_Bool bImport = sal_True );
~ScImportOptionsDlg(); ~ScImportOptionsDlg();
void GetImportOptions( ScImportOptions& rOptions ) const; void GetImportOptions( ScImportOptions& rOptions ) const;
private: private:
FixedLine aFlFieldOpt; VclFrame* m_pFieldFrame;
FixedText aFtFont; FixedText* m_pFtCharset;
SvxTextEncodingBox aLbFont; SvxTextEncodingBox* m_pLbCharset;
FixedText aFtFieldSep; FixedText* m_pFtFieldSep;
ComboBox aEdFieldSep; ComboBox* m_pEdFieldSep;
FixedText aFtTextSep; FixedText* m_pFtTextSep;
ComboBox aEdTextSep; ComboBox* m_pEdTextSep;
CheckBox aCbShown; CheckBox* m_pCbShown;
CheckBox aCbFormulas; CheckBox* m_pCbFormulas;
CheckBox aCbQuoteAll; CheckBox* m_pCbQuoteAll;
CheckBox aCbFixed; CheckBox* m_pCbFixed;
OKButton aBtnOk; OKButton* m_pBtnOk;
CancelButton aBtnCancel;
HelpButton aBtnHelp;
ScDelimiterTable* pFieldSepTab; ScDelimiterTable* pFieldSepTab;
ScDelimiterTable* pTextSepTab; ScDelimiterTable* pTextSepTab;
......
...@@ -309,7 +309,7 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute() throw(uno::RuntimeException) ...@@ -309,7 +309,7 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute() throw(uno::RuntimeException)
ScImportOptions aOptions( cAsciiDel, cStrDel, eEncoding); ScImportOptions aOptions( cAsciiDel, cStrDel, eEncoding);
AbstractScImportOptionsDlg* pDlg = pFact->CreateScImportOptionsDlg( NULL, RID_SCDLG_IMPORTOPT, AbstractScImportOptionsDlg* pDlg = pFact->CreateScImportOptionsDlg(NULL,
bAscii, &aOptions, &aTitle, bMultiByte, bDBEnc, bAscii, &aOptions, &aTitle, bMultiByte, bDBEnc,
!bExport); !bExport);
OSL_ENSURE(pDlg, "Dialog create fail!"); OSL_ENSURE(pDlg, "Dialog create fail!");
......
This diff is collapsed.
...@@ -48,11 +48,19 @@ SvxTextEncodingBox::SvxTextEncodingBox( Window* pParent, WinBits nBits ) ...@@ -48,11 +48,19 @@ SvxTextEncodingBox::SvxTextEncodingBox( Window* pParent, WinBits nBits )
m_pEncTable = new SvxTextEncodingTable; m_pEncTable = new SvxTextEncodingTable;
} }
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvxTextEncodingBox(Window *pParent, VclBuilder::stringmap &) extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvxTextEncodingBox(Window *pParent, VclBuilder::stringmap &rMap)
{ {
WinBits nWinBits = WB_LEFT|WB_DROPDOWN|WB_VCENTER|WB_3DLOOK|WB_SIMPLEMODE; WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_SIMPLEMODE;
bool bDropdown = VclBuilder::extractDropdown(rMap);
if (bDropdown)
nWinBits |= WB_DROPDOWN;
OString sBorder = VclBuilder::extractCustomProperty(rMap);
if (!sBorder.isEmpty())
nWinBits |= WB_BORDER;
SvxTextEncodingBox *pListBox = new SvxTextEncodingBox(pParent, nWinBits); SvxTextEncodingBox *pListBox = new SvxTextEncodingBox(pParent, nWinBits);
pListBox->EnableAutoSize(true); if (bDropdown)
pListBox->EnableAutoSize(true);
return pListBox; return pListBox;
} }
......
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