[Libreoffice-commits] core.git: 3 commits - cui/source libexttextcat/unkown.patch.1 libexttextcat/UnpackedTarball_exttextcat.mk lingucomponent/source sfx2/inc sfx2/source sfx2/uiconfig sfx2/UI_sfx.mk
Michael Stahl
mstahl at redhat.com
Mon Mar 25 08:31:30 PDT 2013
cui/source/customize/acccfg.cxx | 4
libexttextcat/UnpackedTarball_exttextcat.mk | 1
libexttextcat/unkown.patch.1 | 30 ++
lingucomponent/source/languageguessing/guess.cxx | 4
sfx2/UI_sfx.mk | 1
sfx2/inc/sfx2/dinfdlg.hxx | 64 ----
sfx2/source/dialog/dinfdlg.cxx | 325 -----------------------
sfx2/uiconfig/ui/documentpropertiesdialog.ui | 16 -
8 files changed, 36 insertions(+), 409 deletions(-)
New commits:
commit d4244efeb171632f309c8cfcbea4fbe2a3de3193
Author: Michael Stahl <mstahl at redhat.com>
Date: Mon Mar 25 16:28:21 2013 +0100
libexttextcat: fix spelling of _TEXTCAT_RESULT_UNKOWN
and remove the _ prefix too while at it
Change-Id: I30ee8cd5aead53abac19fdc372e1fe45b3cbf55f
diff --git a/libexttextcat/UnpackedTarball_exttextcat.mk b/libexttextcat/UnpackedTarball_exttextcat.mk
index ef90108..c6fa03c 100644
--- a/libexttextcat/UnpackedTarball_exttextcat.mk
+++ b/libexttextcat/UnpackedTarball_exttextcat.mk
@@ -13,6 +13,7 @@ $(eval $(call gb_UnpackedTarball_set_tarball,exttextcat,$(LIBEXTTEXTCAT_TARBALL)
$(eval $(call gb_UnpackedTarball_add_patches,exttextcat,\
libexttextcat/android.patch \
+ libexttextcat/unkown.patch.1 \
))
# vim: set noet sw=4 ts=4:
diff --git a/libexttextcat/unkown.patch.1 b/libexttextcat/unkown.patch.1
new file mode 100644
index 0000000..b57ceeb
--- /dev/null
+++ b/libexttextcat/unkown.patch.1
@@ -0,0 +1,30 @@
+diff -ur exttextcat.old/src/textcat.c exttextcat/src/textcat.c
+--- exttextcat.old/src/textcat.c 2012-11-01 15:40:35.000000000 +0100
++++ exttextcat/src/textcat.c 2013-03-25 16:22:57.226896529 +0100
+@@ -274,10 +274,10 @@
+ switch (cnt)
+ {
+ case TEXTCAT_RESULT_UNKOWN:
+- result = _TEXTCAT_RESULT_UNKOWN;
++ result = TEXTCAT_RESULT_UNKNOWN_STR;
+ break;
+ case TEXTCAT_RESULT_SHORT:
+- result = _TEXTCAT_RESULT_SHORT;
++ result = TEXTCAT_RESULT_SHORT_STR;
+ break;
+ default:
+ {
+diff -ur exttextcat.old/src/textcat.h exttextcat/src/textcat.h
+--- exttextcat.old/src/textcat.h 2012-01-13 22:04:24.000000000 +0100
++++ exttextcat/src/textcat.h 2013-03-25 16:22:11.131896925 +0100
+@@ -40,8 +40,8 @@
+ #include "common.h"
+ #include "textcat_properties.h"
+
+-#define _TEXTCAT_RESULT_UNKOWN "UNKNOWN"
+-#define _TEXTCAT_RESULT_SHORT "SHORT"
++#define TEXTCAT_RESULT_UNKNOWN_STR "UNKNOWN"
++#define TEXTCAT_RESULT_SHORT_STR "SHORT"
+ #define TEXTCAT_RESULT_UNKOWN 0
+ #define TEXTCAT_RESULT_SHORT -2
+
diff --git a/lingucomponent/source/languageguessing/guess.cxx b/lingucomponent/source/languageguessing/guess.cxx
index f107e72..4c8ed8e 100644
--- a/lingucomponent/source/languageguessing/guess.cxx
+++ b/lingucomponent/source/languageguessing/guess.cxx
@@ -57,9 +57,9 @@ Guess::Guess(const char * guess_str)
// &&
// strncmp((const char*)(guess_str + 1), _TEXTCAT_RESULT_SHORT, strlen(_TEXTCAT_RESULT_SHORT)) != 0)
// {
- if(strcmp((const char*)(guess_str + 1), _TEXTCAT_RESULT_UNKNOWN) != 0
+ if(strcmp((const char*)(guess_str + 1), TEXTCAT_RESULT_UNKNOWN_STR) != 0
&&
- strcmp((const char*)(guess_str + 1), _TEXTCAT_RESULT_SHORT) != 0)
+ strcmp((const char*)(guess_str + 1), TEXTCAT_RESULT_SHORT_STR) != 0)
{
int current_pointer = 0;
commit dbba84906d394187b105b9b899ec10065d2d1fc8
Author: Michael Stahl <mstahl at redhat.com>
Date: Sun Mar 24 00:13:20 2013 +0100
remove that silly SfxInternetPage already
LibreOffice is not a web browser.
This reloading stuff apparently never even worked for editable documents
anyway, see i#50881.
Change-Id: I720fbb72fd93232ad3e6fdfc65a05748bdf78108
diff --git a/sfx2/UI_sfx.mk b/sfx2/UI_sfx.mk
index f037060..da23f43 100644
--- a/sfx2/UI_sfx.mk
+++ b/sfx2/UI_sfx.mk
@@ -15,7 +15,6 @@ $(eval $(call gb_UI_add_uifiles,sfx,\
sfx2/uiconfig/ui/descriptioninfopage \
sfx2/uiconfig/ui/documentinfopage \
sfx2/uiconfig/ui/documentpropertiesdialog \
- sfx2/uiconfig/ui/internetinfopage \
sfx2/uiconfig/ui/managestylepage \
sfx2/uiconfig/ui/optprintpage \
sfx2/uiconfig/ui/password \
diff --git a/sfx2/inc/sfx2/dinfdlg.hxx b/sfx2/inc/sfx2/dinfdlg.hxx
index b90b548..4743952 100644
--- a/sfx2/inc/sfx2/dinfdlg.hxx
+++ b/sfx2/inc/sfx2/dinfdlg.hxx
@@ -235,70 +235,6 @@ public:
static SfxTabPage* Create( Window* pParent, const SfxItemSet& );
};
-// class SfxInternetPage -------------------------------------------------
-
-namespace sfx2
-{
- class FileDialogHelper;
-}
-
-class SfxInternetPage : public SfxTabPage
-{
-private:
- VclContainer* m_pContainer;
-
- RadioButton* m_pRBNoAutoUpdate;
- RadioButton* m_pRBReloadUpdate;
- RadioButton* m_pRBForwardUpdate;
-
- FixedText* m_pFTEvery;
- NumericField* m_pNFReload;
- FixedText* m_pFTReloadSeconds;
-
- FixedText* m_pFTAfter;
- NumericField* m_pNFAfter;
- FixedText* m_pFTAfterSeconds;
- FixedText* m_pFTURL;
- Edit* m_pEDForwardURL;
- PushButton* m_pPBBrowseURL;
- FixedText* m_pFTFrame;
- ComboBox* m_pCBFrame;
-
- String aForwardErrorMessg;
- String aBaseURL;
- SfxDocumentInfoItem* pInfoItem;
- sfx2::FileDialogHelper* pFileDlg;
-
- enum STATE { S_Init, S_NoUpdate, S_Reload, S_Forward };
- // S_Init is only valid as initial value
- STATE eState;
-
- void ChangeState( STATE eNewState ); // S_Init is not a valid value here
- // also checks corresponding radiobutton
- void EnableNoUpdate( sal_Bool bEnable );
- void EnableReload( sal_Bool bEnable );
- void EnableForward( sal_Bool bEnable );
-
- DECL_LINK( ClickHdlNoUpdate, Control* );
- DECL_LINK( ClickHdlReload, Control* );
- DECL_LINK( ClickHdlForward, Control* );
- DECL_LINK(ClickHdlBrowseURL, void *);
- DECL_LINK(DialogClosedHdl, void *);
-
- using TabPage::DeactivatePage;
-
-protected:
- SfxInternetPage( Window* pParent, const SfxItemSet& );
- ~SfxInternetPage();
-
- virtual sal_Bool FillItemSet( SfxItemSet& );
- virtual void Reset( const SfxItemSet& );
- virtual int DeactivatePage( SfxItemSet* pSet = 0 );
-
-public:
- static SfxTabPage* Create( Window* pParent, const SfxItemSet& );
-};
-
// class SfxDocumentInfoDialog -------------------------------------------
class SFX2_DLLPUBLIC SfxDocumentInfoDialog : public SfxTabDialog
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 48f8abf..b16b3f1 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -1106,330 +1106,6 @@ void SfxDocumentPage::Reset( const SfxItemSet& rSet )
}
//------------------------------------------------------------------------
-SfxInternetPage::SfxInternetPage( Window* pParent, const SfxItemSet& rItemSet )
- : SfxTabPage(pParent, "InternetInfoPage", "sfx/ui/internetinfopage.ui", rItemSet)
- , aForwardErrorMessg(SFX2_RESSTR(RID_SVXSTR_FORWARD_ERRMSSG))
- , pInfoItem(NULL)
- , pFileDlg(NULL)
- , eState(S_Init)
-{
- get(m_pContainer, "InternetInfoPage");
- get(m_pRBNoAutoUpdate, "noautoupdate");
- get(m_pRBReloadUpdate, "reloadupdate");
- get(m_pRBForwardUpdate, "forwardupdate");
- get(m_pFTEvery, "everyft");
- get(m_pNFReload, "reloadnf");
- get(m_pFTReloadSeconds, "seconds1ft");
- get(m_pFTAfter, "afterft");
- get(m_pNFAfter, "afternf");
- get(m_pFTAfterSeconds, "seconds1ft");
- get(m_pFTURL, "urlft");
- get(m_pEDForwardURL, "forwarded");
- get(m_pPBBrowseURL, "browse");
- get(m_pFTFrame, "frameft");
- get(m_pCBFrame, "framecb");
-
- pInfoItem = &( SfxDocumentInfoItem& ) rItemSet.Get( SID_DOCINFO );
- TargetList aList;
- SfxViewFrame* pFrame = SfxViewFrame::Current();
- if ( pFrame )
- {
- pFrame = pFrame->GetTopViewFrame();
- if ( pFrame )
- {
- pFrame->GetTargetList( aList );
-
- String* pObj;
- for ( size_t nPos = aList.size() ; nPos ; )
- {
- pObj = aList[ --nPos ];
- m_pCBFrame->InsertEntry( *pObj );
- delete pObj;
- }
- }
- }
-
- m_pRBNoAutoUpdate->SetClickHdl( LINK( this, SfxInternetPage, ClickHdlNoUpdate ) );
- m_pRBReloadUpdate->SetClickHdl( LINK( this, SfxInternetPage, ClickHdlReload ) );
- m_pRBForwardUpdate->SetClickHdl( LINK( this, SfxInternetPage, ClickHdlForward ) );
- m_pPBBrowseURL->SetClickHdl( LINK( this, SfxInternetPage, ClickHdlBrowseURL ) );
-
- aForwardErrorMessg.SearchAndReplaceAscii("%PLACEHOLDER%", m_pRBForwardUpdate->GetText());
-
- ChangeState( S_NoUpdate );
-}
-
-//------------------------------------------------------------------------
-SfxInternetPage::~SfxInternetPage()
-{
- delete pFileDlg;
-}
-
-//------------------------------------------------------------------------
-void SfxInternetPage::ChangeState( STATE eNewState )
-{
- DBG_ASSERT( eNewState != S_Init, "*SfxInternetPage::ChangeState(): new state init is supposed to not work here!" );
-
- if ( eState == eNewState )
- return;
-
- switch ( eState )
- {
- case S_Init:
- EnableNoUpdate( sal_True );
- EnableReload( sal_False );
- EnableForward( sal_False );
- break;
- case S_NoUpdate:
- EnableNoUpdate( sal_False );
- if( eNewState == S_Reload )
- EnableReload( sal_True );
- else
- EnableForward( sal_True );
- break;
- case S_Reload:
- EnableReload( sal_False );
- if( eNewState == S_NoUpdate )
- EnableNoUpdate( sal_True );
- else
- EnableForward( sal_True );
- break;
- case S_Forward:
- EnableForward( sal_False );
- if( eNewState == S_NoUpdate )
- EnableNoUpdate( sal_True );
- else
- EnableReload( sal_True );
- break;
- default:
- OSL_FAIL( "*SfxInternetPage::SetState(): unhandled state!" );
- }
-
- eState = eNewState;
-}
-
-//------------------------------------------------------------------------
-
-void SfxInternetPage::EnableNoUpdate( sal_Bool bEnable )
-{
- if ( bEnable )
- m_pRBNoAutoUpdate->Check();
-}
-
-//------------------------------------------------------------------------
-
-void SfxInternetPage::EnableReload( sal_Bool bEnable )
-{
- m_pFTEvery->Enable( bEnable );
- m_pNFReload->Enable( bEnable );
- m_pFTReloadSeconds->Enable( bEnable );
-
- if ( bEnable )
- m_pRBReloadUpdate->Check();
-}
-
-//------------------------------------------------------------------------
-
-void SfxInternetPage::EnableForward( sal_Bool bEnable )
-{
- m_pFTAfter->Enable( bEnable );
- m_pNFAfter->Enable( bEnable );
- m_pFTAfterSeconds->Enable( bEnable );
- m_pFTURL->Enable( bEnable );
- m_pEDForwardURL->Enable( bEnable );
- m_pPBBrowseURL->Enable( bEnable );
- m_pFTFrame->Enable( bEnable );
- m_pCBFrame->Enable( bEnable );
-
- if ( bEnable )
- m_pRBForwardUpdate->Check();
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SfxInternetPage, ClickHdlNoUpdate, Control*, pCtrl )
-{
- (void)pCtrl; //unused
- ChangeState( S_NoUpdate );
- return 0;
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SfxInternetPage, ClickHdlReload, Control*, pCtrl )
-{
- (void)pCtrl; //unused
- ChangeState( S_Reload );
- return 0;
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK( SfxInternetPage, ClickHdlForward, Control*, pCtrl )
-{
- (void)pCtrl; //unused
- ChangeState( S_Forward );
- return 0;
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK_NOARG(SfxInternetPage, ClickHdlBrowseURL)
-{
- if ( !pFileDlg )
- pFileDlg = new sfx2::FileDialogHelper(
- TemplateDescription::FILEOPEN_SIMPLE, 0 );
- pFileDlg->SetDisplayDirectory( m_pEDForwardURL->GetText() );
- pFileDlg->StartExecuteModal( LINK( this, SfxInternetPage, DialogClosedHdl ) );
-
- return 0;
-}
-
-//------------------------------------------------------------------------
-
-IMPL_LINK_NOARG(SfxInternetPage, DialogClosedHdl)
-{
- DBG_ASSERT( pFileDlg, "SfxInternetPage::DialogClosedHdl(): no file dialog" );
-
- if ( ERRCODE_NONE == pFileDlg->GetError() )
- m_pEDForwardURL->SetText( pFileDlg->GetPath() );
-
- return 0;
-}
-
-//------------------------------------------------------------------------
-
-sal_Bool SfxInternetPage::FillItemSet( SfxItemSet& rSet )
-{
- const SfxPoolItem* pItem = NULL;
- SfxDocumentInfoItem* pInfo = NULL;
- SfxTabDialog* pDlg = GetTabDialog();
- const SfxItemSet* pExSet = NULL;
-
- if ( pDlg )
- pExSet = pDlg->GetExampleSet();
-
- if ( pExSet && SFX_ITEM_SET != pExSet->GetItemState( SID_DOCINFO, sal_True, &pItem ) )
- pInfo = pInfoItem;
- else if ( pItem )
- pInfo = new SfxDocumentInfoItem( *(const SfxDocumentInfoItem*)pItem );
-
- if ( !pInfo )
- {
- SAL_WARN( "sfx2.dialog", "SfxInternetPage::FillItemSet(): no item found" );
- return sal_False;
- }
-
- DBG_ASSERT( eState != S_Init, "*SfxInternetPage::FillItemSet(): state init is not acceptable at this point!" );
-
- sal_Bool bEnableReload = sal_False;
- SAL_WNODEPRECATED_DECLARATIONS_PUSH
- ::std::auto_ptr< String > aURL( NULL );
- ::std::auto_ptr< String > aFrame( NULL );
- SAL_WNODEPRECATED_DECLARATIONS_POP
- sal_uIntPtr nDelay = 0;
-
- switch ( eState )
- {
- case S_NoUpdate:
- break;
- case S_Reload:
- bEnableReload = sal_True;
- SAL_WNODEPRECATED_DECLARATIONS_PUSH
- aURL = ::std::auto_ptr< String >( new String() );
- aFrame = ::std::auto_ptr< String >( new String() );
- SAL_WNODEPRECATED_DECLARATIONS_POP
- nDelay = static_cast<sal_uIntPtr>(m_pNFReload->GetValue());
- break;
- case S_Forward:
- SAL_WARN_IF(m_pEDForwardURL->GetText().isEmpty(), "sfx2.dialog",
- "+SfxInternetPage::FillItemSet(): empty URL should be not possible for forward option!");
-
- bEnableReload = sal_True;
- SAL_WNODEPRECATED_DECLARATIONS_PUSH
- aURL = ::std::auto_ptr< String >( new String( URIHelper::SmartRel2Abs( INetURLObject(aBaseURL), m_pEDForwardURL->GetText(), URIHelper::GetMaybeFileHdl(), true ) ) );
- aFrame = ::std::auto_ptr< String >( new String( m_pCBFrame->GetText() ) );
- SAL_WNODEPRECATED_DECLARATIONS_POP
- nDelay = static_cast<sal_uIntPtr>(m_pNFAfter->GetValue());
- break;
- default:
- break;
- }
-
- pInfo->setAutoloadEnabled( bEnableReload );
-
- if ( bEnableReload )
- {
- pInfo->setAutoloadURL( *aURL.get() );
- pInfo->setDefaultTarget( *aFrame.get() );
- pInfo->setAutoloadDelay( nDelay );
- }
-
- rSet.Put( *pInfo );
- if ( pInfo != pInfoItem )
- delete pInfo;
- return sal_True;
-}
-
-//------------------------------------------------------------------------
-SfxTabPage *SfxInternetPage::Create( Window* pParent, const SfxItemSet& rItemSet )
-{
- return new SfxInternetPage(pParent, rItemSet);
-}
-
-//------------------------------------------------------------------------
-void SfxInternetPage::Reset( const SfxItemSet& rSet )
-{
- pInfoItem = &( SfxDocumentInfoItem& ) rSet.Get( SID_DOCINFO );
- SFX_ITEMSET_ARG( &rSet, pURLItem, SfxStringItem, SID_BASEURL, sal_False );
- DBG_ASSERT( pURLItem, "No BaseURL provided for InternetTabPage!" );
- if ( pURLItem )
- aBaseURL = pURLItem->GetValue();
-
- STATE eNewState = S_NoUpdate;
-
- if ( pInfoItem->isAutoloadEnabled() )
- {
- const String& rURL = pInfoItem->getAutoloadURL();
-
- if( rURL.Len() )
- {
- m_pNFAfter->SetValue( pInfoItem->getAutoloadDelay() );
- m_pEDForwardURL->SetText( rURL );
- m_pCBFrame->SetText( pInfoItem->getDefaultTarget() );
- eNewState = S_Forward;
- }
- else
- {
- m_pNFReload->SetValue( pInfoItem->getAutoloadDelay() );
- eNewState = S_Reload;
- }
- }
-
- ChangeState( eNewState );
-
- SFX_ITEMSET_ARG( &rSet, pROItem, SfxBoolItem, SID_DOC_READONLY, sal_False );
- if ( pROItem && pROItem->GetValue() )
- m_pContainer->Disable();
-}
-
-//------------------------------------------------------------------------
-int SfxInternetPage::DeactivatePage( SfxItemSet* /*pSet*/ )
-{
- int nRet = LEAVE_PAGE;
-
- if ( eState == S_Forward && m_pEDForwardURL->GetText().isEmpty() )
- {
- ErrorBox aErrBox( this, WB_OK, aForwardErrorMessg );
- aErrBox.Execute();
-
- nRet = KEEP_PAGE;
- }
-
- return nRet;
-}
-
-//------------------------------------------------------------------------
SfxDocumentInfoDialog::SfxDocumentInfoDialog( Window* pParent,
const SfxItemSet& rItemSet )
: SfxTabDialog(0, pParent, "DocumentPropertiesDialog",
@@ -1479,7 +1155,6 @@ SfxDocumentInfoDialog::SfxDocumentInfoDialog( Window* pParent,
m_nDocInfoId = AddTabPage("general", SfxDocumentPage::Create, 0);
AddTabPage("description", SfxDocumentDescPage::Create, 0);
AddTabPage("customprops", SfxCustomPropertiesPage::Create, 0);
- AddTabPage("internet", SfxInternetPage::Create, 0);
AddTabPage("security", SfxSecurityPage::Create, 0);
}
diff --git a/sfx2/uiconfig/ui/documentpropertiesdialog.ui b/sfx2/uiconfig/ui/documentpropertiesdialog.ui
index 9012aaf..bb2375e 100644
--- a/sfx2/uiconfig/ui/documentpropertiesdialog.ui
+++ b/sfx2/uiconfig/ui/documentpropertiesdialog.ui
@@ -130,27 +130,13 @@
<placeholder/>
</child>
<child type="tab">
- <object class="GtkLabel" id="internet">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">Internet </property>
- </object>
- <packing>
- <property name="position">3</property>
- <property name="tab_fill">False</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
- <child type="tab">
<object class="GtkLabel" id="security">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Security</property>
</object>
<packing>
- <property name="position">4</property>
+ <property name="position">3</property>
<property name="tab_fill">False</property>
</packing>
</child>
commit d2605c0b1026aba39085913c69da1f9974430e20
Author: Michael Stahl <mstahl at redhat.com>
Date: Sat Mar 23 23:25:58 2013 +0100
cui: replace DBG_ASSERTs with bogus messages
Change-Id: I0646224e50d36db0171c063bd68e8eb6b4b6519c
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx
index d2aa512..f1dda16 100644
--- a/cui/source/customize/acccfg.cxx
+++ b/cui/source/customize/acccfg.cxx
@@ -1202,7 +1202,7 @@ IMPL_LINK_NOARG(SfxAcceleratorConfigPage, RadioHdl)
//-----------------------------------------------
IMPL_LINK_NOARG(SfxAcceleratorConfigPage, LoadHdl)
{
- DBG_ASSERT( m_pFileDlg, "SfxInternetPage::DialogClosedHdl(): no file dialog" );
+ assert(m_pFileDlg);
OUString sCfgName;
if ( ERRCODE_NONE == m_pFileDlg->GetError() )
@@ -1286,7 +1286,7 @@ IMPL_LINK_NOARG(SfxAcceleratorConfigPage, LoadHdl)
//-----------------------------------------------
IMPL_LINK_NOARG(SfxAcceleratorConfigPage, SaveHdl)
{
- DBG_ASSERT( m_pFileDlg, "SfxInternetPage::DialogClosedHdl(): no file dialog" );
+ assert(m_pFileDlg);
OUString sCfgName;
if ( ERRCODE_NONE == m_pFileDlg->GetError() )
More information about the Libreoffice-commits
mailing list