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

convert ascii filter dialog to .ui

Change-Id: I0e4f45d9e74fd2ae04defa75fce225d61295cdbc
üst ac36ecb2
......@@ -94,7 +94,6 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\
sw/source/ui/dbui/mmpreparemergepage.src \
sw/source/ui/dbui/selectdbtabledialog.src \
sw/source/ui/dialog/abstract.src \
sw/source/ui/dialog/ascfldlg.src \
sw/source/ui/dialog/dialog.src \
sw/source/ui/dialog/regionsw.src \
sw/source/ui/dochdl/dochdl.src \
......
......@@ -59,6 +59,7 @@ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/swriter,\
))
$(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/asciifilterdialog \
sw/uiconfig/swriter/ui/autoformattable \
sw/uiconfig/swriter/ui/autotext \
sw/uiconfig/swriter/ui/bibliographyentry \
......
......@@ -27,7 +27,6 @@
#define DLG_PASSWD (RC_DIALOG_BEGIN + 3)
#define DLG_INSERT_ABSTRACT (RC_DIALOG_BEGIN + 8)
#define DLG_ASCII_FILTER (RC_DIALOG_BEGIN + 9)
#define RID_QB_SPELL_CONTINUE (RC_DIALOG_BEGIN + 11)
#define STR_SPELLING_COMPLETED (RC_DIALOG_BEGIN + 12)
......
......@@ -139,7 +139,6 @@
#define HID_FILEDLG_WIZDOKU "SW_HID_FILEDLG_WIZDOKU"
#define HID_MULTI_TOX_DLG "SW_HID_MULTI_TOX_DLG"
#define HID_ASCII_FILTER "SW_HID_ASCII_FILTER"
#define HID_GLBLTREE_EDIT_LINK "SW_HID_GLBLTREE_EDIT_LINK"
#define HID_FORMAT_NAME_OBJECT_NAME "SW_HID_FORMAT_NAME_OBJECT_NAME"
#define HID_REFSELECTION_TOOLTIP "SW_HID_REFSELECTION_TOOLTIP" // #i83479#
......
......@@ -334,7 +334,7 @@ public:
virtual AbstractSwInsertAbstractDlg * CreateSwInsertAbstractDlg(Window* pParent) = 0; // add for SwInsertAbstractDlg
virtual AbstractSwAsciiFilterDlg* CreateSwAsciiFilterDlg ( Window* pParent, SwDocShell& rDocSh,
SvStream* pStream, int nResId ) = 0;// add for SwAsciiFilterDlg
SvStream* pStream ) = 0;// add for SwAsciiFilterDlg
virtual VclAbstractDialog * CreateSwInsertBookmarkDlg( Window *pParent, SwWrtShell &rSh, SfxRequest& rReq, int nResId ) = 0;// add for SwInsertBookmarkDlg
virtual AbstractSwBreakDlg * CreateSwBreakDlg(Window *pParent, SwWrtShell &rSh) = 0; // add for SwBreakDlg
......
......@@ -38,7 +38,6 @@
#include <doc.hxx>
#include <dialog.hrc>
#include <ascfldlg.hrc>
#include "vcl/metric.hxx"
......@@ -52,25 +51,20 @@ const sal_uInt16 nDialogExtraDataLen = 11; // 12345678901
SwAsciiFilterDlg::SwAsciiFilterDlg( Window* pParent, SwDocShell& rDocSh,
SvStream* pStream )
: SfxModalDialog( pParent, SW_RES( DLG_ASCII_FILTER )),
aFL( this, SW_RES( FL_1 )),
aCharSetFT( this, SW_RES( FT_CHARSET )),
aCharSetLB( this, SW_RES( LB_CHARSET )),
aFontFT( this, SW_RES( FT_FONT )),
aFontLB( this, SW_RES( LB_FONT )),
aLanguageFT( this, SW_RES( FT_LANGUAGE )),
aLanguageLB( this, SW_RES( LB_LANGUAGE )),
aCRLF_FT( this, SW_RES( FT_CRLF )),
aCRLF_RB( this, SW_RES( RB_CRLF )),
aCR_RB( this, SW_RES( RB_CR )),
aLF_RB( this, SW_RES( RB_LF )),
aOkPB( this, SW_RES( PB_OK )),
aCancelPB( this, SW_RES( PB_CANCEL )),
aHelpPB( this, SW_RES( PB_HELP )),
sSystemCharSet( SW_RES( STR_SYS_CHARSET )),
bSaveLineStatus( true )
: SfxModalDialog(pParent, "AsciiFilterDialog", "modules/swriter/ui/asciifilterdialog.ui")
, m_bSaveLineStatus(true)
{
FreeResource();
get(m_pCharSetLB, "charset");
m_pCharSetLB->SetStyle(m_pCharSetLB->GetStyle() | WB_SORT);
get(m_pFontFT, "fontft");
get(m_pFontLB, "font");
m_pFontLB->SetStyle(m_pFontLB->GetStyle() | WB_SORT);
get(m_pLanguageFT, "languageft");
get(m_pLanguageLB, "language");
m_pLanguageLB->SetStyle(m_pLanguageLB->GetStyle() | WB_SORT);
get(m_pCRLF_RB, "crlf");
get(m_pCR_RB, "cr");
get(m_pLF_RB, "lf");
SwAsciiOptions aOpt;
{
......@@ -169,8 +163,8 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( Window* pParent, SwDocShell& rDocSh,
}
}
aLanguageLB.SetLanguageList( LANG_LIST_ALL, sal_True, sal_False );
aLanguageLB.SelectLanguage( aOpt.GetLanguage() );
m_pLanguageLB->SetLanguageList( LANG_LIST_ALL, sal_True, sal_False );
m_pLanguageLB->SelectLanguage( aOpt.GetLanguage() );
}
{
......@@ -199,7 +193,7 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( Window* pParent, SwDocShell& rDocSh,
for( std::set< String >::const_iterator it = aFontNames.begin();
it != aFontNames.end(); ++it )
{
aFontLB.InsertEntry( *it );
m_pFontLB->InsertEntry( *it );
}
if( !aOpt.GetFontName().Len() )
......@@ -209,7 +203,7 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( Window* pParent, SwDocShell& rDocSh,
aOpt.SetFontName(aTmpFont.GetName());
}
aFontLB.SelectEntry( aOpt.GetFontName() );
m_pFontLB->SelectEntry( aOpt.GetFontName() );
if( bDelPrinter )
delete pPrt;
......@@ -219,48 +213,27 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( Window* pParent, SwDocShell& rDocSh,
}
else
{
// hide the used Control for the Export and move the
// other behind the charset controls
aFontFT.Hide();
aFontLB.Hide();
aLanguageFT.Hide();
aLanguageLB.Hide();
long nY = aFontFT.GetPosPixel().Y() + 1;
Point aPos( aCRLF_FT.GetPosPixel() ); aPos.Y() = nY;
aCRLF_FT.SetPosPixel( aPos );
aPos = aCRLF_RB.GetPosPixel(); aPos.Y() = nY;
aCRLF_RB.SetPosPixel( aPos );
aPos = aCR_RB.GetPosPixel(); aPos.Y() = nY;
aCR_RB.SetPosPixel( aPos );
aPos = aLF_RB.GetPosPixel(); aPos.Y() = nY;
aLF_RB.SetPosPixel( aPos );
Size aSize = GetSizePixel();
Size aTmpSz( 6, 6 );
aTmpSz = LogicToPixel(aTmpSz, MAP_APPFONT);
aSize.Height() = aHelpPB.GetPosPixel().Y() +
aHelpPB.GetSizePixel().Height() + aTmpSz.Height();
SetSizePixel( aSize );
// hide the unused Controls for Export
m_pFontFT->Hide();
m_pFontLB->Hide();
m_pLanguageFT->Hide();
m_pLanguageLB->Hide();
}
// initialise character set
aCharSetLB.FillFromTextEncodingTable( pStream != NULL );
aCharSetLB.SelectTextEncoding( aOpt.GetCharSet() );
m_pCharSetLB->FillFromTextEncodingTable( pStream != NULL );
m_pCharSetLB->SelectTextEncoding( aOpt.GetCharSet() );
aCharSetLB.SetSelectHdl( LINK( this, SwAsciiFilterDlg, CharSetSelHdl ));
aCRLF_RB.SetToggleHdl( LINK( this, SwAsciiFilterDlg, LineEndHdl ));
aLF_RB.SetToggleHdl( LINK( this, SwAsciiFilterDlg, LineEndHdl ));
aCR_RB.SetToggleHdl( LINK( this, SwAsciiFilterDlg, LineEndHdl ));
m_pCharSetLB->SetSelectHdl( LINK( this, SwAsciiFilterDlg, CharSetSelHdl ));
m_pCRLF_RB->SetToggleHdl( LINK( this, SwAsciiFilterDlg, LineEndHdl ));
m_pLF_RB->SetToggleHdl( LINK( this, SwAsciiFilterDlg, LineEndHdl ));
m_pCR_RB->SetToggleHdl( LINK( this, SwAsciiFilterDlg, LineEndHdl ));
SetCRLF( aOpt.GetParaFlags() );
aCRLF_RB.SaveValue();
aLF_RB.SaveValue();
aCR_RB.SaveValue();
m_pCRLF_RB->SaveValue();
m_pLF_RB->SaveValue();
m_pCR_RB->SaveValue();
}
......@@ -271,13 +244,13 @@ SwAsciiFilterDlg::~SwAsciiFilterDlg()
void SwAsciiFilterDlg::FillOptions( SwAsciiOptions& rOptions )
{
sal_uLong nCCode = aCharSetLB.GetSelectTextEncoding();
sal_uLong nCCode = m_pCharSetLB->GetSelectTextEncoding();
String sFont;
sal_uLong nLng = 0;
if( aFontLB.IsVisible() )
if( m_pFontLB->IsVisible() )
{
sFont = aFontLB.GetSelectEntry();
nLng = (sal_uLong)aLanguageLB.GetSelectLanguage();
sFont = m_pFontLB->GetSelectEntry();
nLng = (sal_uLong)m_pLanguageLB->GetSelectLanguage();
}
rOptions.SetFontName( sFont );
......@@ -291,7 +264,7 @@ void SwAsciiFilterDlg::FillOptions( SwAsciiOptions& rOptions )
if( sData.Len() )
{
const OUString sFindNm = OUString::createFromAscii(
aFontLB.IsVisible() ? sDialogImpExtraData
m_pFontLB->IsVisible() ? sDialogImpExtraData
: sDialogExpExtraData);
sal_uInt16 nEnd, nStt = GetExtraData().Search( sFindNm );
if( STRING_NOTFOUND != nStt )
......@@ -314,18 +287,18 @@ void SwAsciiFilterDlg::SetCRLF( LineEnd eEnd )
{
switch( eEnd )
{
case LINEEND_CR: aCR_RB.Check(); break;
case LINEEND_CRLF: aCRLF_RB.Check(); break;
case LINEEND_LF: aLF_RB.Check(); break;
case LINEEND_CR: m_pCR_RB->Check(); break;
case LINEEND_CRLF: m_pCRLF_RB->Check(); break;
case LINEEND_LF: m_pLF_RB->Check(); break;
}
}
LineEnd SwAsciiFilterDlg::GetCRLF() const
{
LineEnd eEnd;
if( aCR_RB.IsChecked() )
if( m_pCR_RB->IsChecked() )
eEnd = LINEEND_CR;
else if( aLF_RB.IsChecked() )
else if( m_pLF_RB->IsChecked() )
eEnd = LINEEND_LF;
else
eEnd = LINEEND_CRLF;
......@@ -335,8 +308,8 @@ LineEnd SwAsciiFilterDlg::GetCRLF() const
IMPL_LINK( SwAsciiFilterDlg, CharSetSelHdl, SvxTextEncodingBox*, pBox )
{
LineEnd eOldEnd = GetCRLF(), eEnd = (LineEnd)-1;
LanguageType nLng = aFontLB.IsVisible()
? aLanguageLB.GetSelectLanguage()
LanguageType nLng = m_pFontLB->IsVisible()
? m_pLanguageLB->GetSelectLanguage()
: LANGUAGE_SYSTEM,
nOldLng = nLng;
......@@ -387,7 +360,7 @@ IMPL_LINK( SwAsciiFilterDlg, CharSetSelHdl, SvxTextEncodingBox*, pBox )
}
}
bSaveLineStatus = false;
m_bSaveLineStatus = false;
if( eEnd != (LineEnd)-1 ) // changed?
{
if( eOldEnd != eEnd )
......@@ -396,21 +369,21 @@ IMPL_LINK( SwAsciiFilterDlg, CharSetSelHdl, SvxTextEncodingBox*, pBox )
else
{
// restore old user choise (not the automatic!)
aCRLF_RB.Check( aCRLF_RB.GetSavedValue() );
aCR_RB.Check( aCR_RB.GetSavedValue() );
aLF_RB.Check( aLF_RB.GetSavedValue() );
m_pCRLF_RB->Check( m_pCRLF_RB->GetSavedValue() );
m_pCR_RB->Check( m_pCR_RB->GetSavedValue() );
m_pLF_RB->Check( m_pLF_RB->GetSavedValue() );
}
bSaveLineStatus = true;
m_bSaveLineStatus = true;
if( nOldLng != nLng && aFontLB.IsVisible() )
aLanguageLB.SelectLanguage( nLng );
if( nOldLng != nLng && m_pFontLB->IsVisible() )
m_pLanguageLB->SelectLanguage( nLng );
return 0;
}
IMPL_LINK( SwAsciiFilterDlg, LineEndHdl, RadioButton*, pBtn )
{
if( bSaveLineStatus )
if( m_bSaveLineStatus )
pBtn->SaveValue();
return 0;
}
......
/* -*- 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 .
*/
#define FL_1 1
#define FT_CHARSET 2
#define LB_CHARSET 3
#define FT_FONT 4
#define LB_FONT 5
#define FT_LANGUAGE 6
#define LB_LANGUAGE 7
#define FT_CRLF 8
#define RB_CRLF 9
#define RB_CR 10
#define RB_LF 11
#define PB_OK 12
#define PB_CANCEL 13
#define PB_HELP 14
#define STR_SYS_CHARSET 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 "dialog.hrc"
#include "helpid.h"
#include "ascfldlg.hrc"
ModalDialog DLG_ASCII_FILTER
{
HelpID = HID_ASCII_FILTER ;
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 239 , 80 ) ;
Moveable = TRUE ;
FixedLine FL_1
{
OutputSize = TRUE ;
Pos = MAP_APPFONT ( 6 , 3 ) ;
Size = MAP_APPFONT ( 170 , 8 ) ;
Text [ en-US ] = "Properties";
};
FixedText FT_CHARSET
{
Pos = MAP_APPFONT ( 12 , 15 ) ;
Size = MAP_APPFONT ( 66 , 10 ) ;
Text [ en-US ] = "~Character set";
};
ListBox LB_CHARSET
{
HelpID = "sw:ListBox:DLG_ASCII_FILTER:LB_CHARSET";
Pos = MAP_APPFONT ( 80 , 14 ) ;
Size = MAP_APPFONT ( 90 , 61 ) ;
TabStop = TRUE ;
DropDown = TRUE ;
Sort = TRUE ;
};
FixedText FT_FONT
{
Pos = MAP_APPFONT ( 12 , 31 ) ;
Size = MAP_APPFONT ( 66 , 10 ) ;
Text [ en-US ] = "Default fonts";
};
ListBox LB_FONT
{
HelpID = "sw:ListBox:DLG_ASCII_FILTER:LB_FONT";
Pos = MAP_APPFONT ( 80 , 30 ) ;
Size = MAP_APPFONT ( 90 , 61 ) ;
TabStop = TRUE ;
DropDown = TRUE ;
Sort = TRUE ;
};
FixedText FT_LANGUAGE
{
Pos = MAP_APPFONT ( 12 , 47 ) ;
Size = MAP_APPFONT ( 66 , 10 ) ;
Text [ en-US ] = "Lan~guage";
};
ListBox LB_LANGUAGE
{
HelpID = "sw:ListBox:DLG_ASCII_FILTER:LB_LANGUAGE";
Pos = MAP_APPFONT ( 80 , 46 ) ;
Size = MAP_APPFONT ( 90 , 61 ) ;
TabStop = TRUE ;
DropDown = TRUE ;
Sort = TRUE ;
};
FixedText FT_CRLF
{
Pos = MAP_APPFONT ( 12 , 64 ) ;
Size = MAP_APPFONT ( 66 , 8 ) ;
Text [ en-US ] = "~Paragraph break";
};
RadioButton RB_CRLF
{
HelpID = "sw:RadioButton:DLG_ASCII_FILTER:RB_CRLF";
Pos = MAP_APPFONT ( 80 , 64 ) ;
Size = MAP_APPFONT ( 40 , 10 ) ;
TabStop = TRUE ;
Check = TRUE;
Text [ en-US ] = "~CR & LF";
};
RadioButton RB_CR
{
HelpID = "sw:RadioButton:DLG_ASCII_FILTER:RB_CR";
Pos = MAP_APPFONT ( 121 , 64 ) ;
Size = MAP_APPFONT ( 20 , 10 ) ;
// TabStop = TRUE ;
Text [ en-US ] = "C~R";
};
RadioButton RB_LF
{
HelpID = "sw:RadioButton:DLG_ASCII_FILTER:RB_LF";
Pos = MAP_APPFONT ( 155 , 64 ) ;
Size = MAP_APPFONT ( 20 , 10 ) ;
// TabStop = TRUE ;
Text [ en-US ] = "~LF";
};
OKButton PB_OK
{
Pos = MAP_APPFONT ( 183 , 6 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
DefButton = TRUE ;
};
CancelButton PB_CANCEL
{
Pos = MAP_APPFONT ( 183 , 23 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
};
HelpButton PB_HELP
{
Pos = MAP_APPFONT ( 183 , 43 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
};
String STR_SYS_CHARSET
{
Text [ en-US ] = "System";
};
Text [ en-US ] = "ASCII Filter Options";
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -665,23 +665,10 @@ SfxAbstractDialog* SwAbstractDialogFactory_Impl::CreateSfxDialog( Window* pParen
AbstractSwAsciiFilterDlg* SwAbstractDialogFactory_Impl::CreateSwAsciiFilterDlg( Window* pParent,
SwDocShell& rDocSh,
SvStream* pStream,
int nResId )
SvStream* pStream )
{
SwAsciiFilterDlg* pDlg=NULL;
switch ( nResId )
{
case DLG_ASCII_FILTER :
pDlg = new SwAsciiFilterDlg( pParent, rDocSh, pStream );
break;
default:
break;
}
if ( pDlg )
SwAsciiFilterDlg* pDlg = new SwAsciiFilterDlg( pParent, rDocSh, pStream );
return new AbstractSwAsciiFilterDlg_Impl( pDlg );
return 0;
}
VclAbstractDialog* SwAbstractDialogFactory_Impl::CreateSwInsertBookmarkDlg( Window *pParent,
......
......@@ -439,7 +439,7 @@ public:
SfxChildWindow* pChild, Window *pParent, SfxChildWinInfo* pInfo);
virtual AbstractSwInsertAbstractDlg * CreateSwInsertAbstractDlg(Window* pParent);
virtual AbstractSwAsciiFilterDlg* CreateSwAsciiFilterDlg ( Window* pParent, SwDocShell& rDocSh,
SvStream* pStream, int nResId ); //add for SwAsciiFilterDlg
SvStream* pStream ); //add for SwAsciiFilterDlg
virtual VclAbstractDialog * CreateSwInsertBookmarkDlg( Window *pParent, SwWrtShell &rSh, SfxRequest& rReq, int nResId );//add for SwInsertBookmarkDlg
virtual AbstractSwBreakDlg * CreateSwBreakDlg(Window *pParent, SwWrtShell &rSh); // add for SwBreakDlg
virtual VclAbstractDialog * CreateSwChangeDBDlg(SwView& rVw); //add for SwChangeDBDlg
......
......@@ -32,20 +32,15 @@ class SwDocShell;
class SwAsciiFilterDlg : public SfxModalDialog
{
FixedLine aFL;
FixedText aCharSetFT;
SvxTextEncodingBox aCharSetLB;
FixedText aFontFT;
ListBox aFontLB;
FixedText aLanguageFT;
SvxLanguageBox aLanguageLB;
FixedText aCRLF_FT;
RadioButton aCRLF_RB, aCR_RB, aLF_RB;
OKButton aOkPB;
CancelButton aCancelPB;
HelpButton aHelpPB;
String sSystemCharSet;
bool bSaveLineStatus;
SvxTextEncodingBox* m_pCharSetLB;
FixedText* m_pFontFT;
ListBox* m_pFontLB;
FixedText* m_pLanguageFT;
SvxLanguageBox* m_pLanguageLB;
RadioButton* m_pCRLF_RB;
RadioButton* m_pCR_RB;
RadioButton* m_pLF_RB;
bool m_bSaveLineStatus;
DECL_LINK( CharSetSelHdl, SvxTextEncodingBox* );
DECL_LINK( LineEndHdl, RadioButton* );
......
......@@ -119,7 +119,8 @@ sal_Int16 SwXFilterOptions::execute() throw (uno::RuntimeException)
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
AbstractSwAsciiFilterDlg* pAsciiDlg = pFact->CreateSwAsciiFilterDlg( NULL, *pDocShell,pInStream, DLG_ASCII_FILTER );
AbstractSwAsciiFilterDlg* pAsciiDlg = pFact->CreateSwAsciiFilterDlg(NULL, *pDocShell,
pInStream);
OSL_ENSURE(pAsciiDlg, "Dialogdiet fail!");
if(RET_OK == pAsciiDlg->Execute())
{
......
This diff is collapsed.
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