[Libreoffice-commits] .: sfx2/source
sfx2/source/doc/templatedlg.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit 4651402a5399e00f62311bb3fe545413b0818a2d Author: Cédric Bosdonnat Date: Mon Jan 28 18:50:39 2013 +0100 Template Manager: focus in search edit when clicking search action diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index b756111..d3721ab 100644 --- a/sfx2/source/doc/templatedlg.cxx +++ b/sfx2/source/doc/templatedlg.cxx @@ -964,6 +964,8 @@ void SfxTemplateManagerDlg::OnTemplateSearch () mpSearchEdit->Show(!bVisible); mpSearchEdit->SetText(OUString()); +if (!bVisible) +mpSearchEdit->GrabFocus(); // display all templates if we hide the search bar if (bVisible && mpCurView->isOverlayVisible()) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/doc/templatedlg.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit 2064d3df551b651479c0602e197674d4efede15f Author: Cédric Bosdonnat Date: Mon Jan 28 17:51:54 2013 +0100 Template Manager: don't show any tab and show all folders when saving template diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index 824cfc1..b756111 100644 --- a/sfx2/source/doc/templatedlg.cxx +++ b/sfx2/source/doc/templatedlg.cxx @@ -227,6 +227,8 @@ SfxTemplateManagerDlg::~SfxTemplateManagerDlg () void SfxTemplateManagerDlg::setSaveMode(bool bMode) { mbIsSaveMode = bMode; +maTabControl.Clear(); +mpCurView->filterTemplatesByApp(FILTER_APP_NONE); if (bMode) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/doc/templatedlg.cxx |8 1 file changed, 8 insertions(+) New commits: commit 23baf527ffc9c082dcbc6a328019760725cc0c08 Author: Cédric Bosdonnat Date: Thu Jan 24 16:50:32 2013 +0100 Template Manager: remote repositories only for experimental mode Change-Id: I79501bdcd25f362065d9b95efd1a43f6be84577e diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index 11fddc2..824cfc1 100644 --- a/sfx2/source/doc/templatedlg.cxx +++ b/sfx2/source/doc/templatedlg.cxx @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -178,6 +179,13 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent) maTabControl.SetActivatePageHdl(LINK(this,SfxTemplateManagerDlg,ActivatePageHdl)); +SvtMiscOptions aMiscOptions; +if ( !aMiscOptions.IsExperimentalMode() ) +{ +sal_uInt16 nPos = mpViewBar->GetItemId(TBI_TEMPLATE_REPOSITORY); +mpViewBar->RemoveItem(nPos); +} + mpViewBar->Show(); mpActionBar->Show(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/dialog/templdlg.cxx | 105 1 file changed, 76 insertions(+), 29 deletions(-) New commits: commit 439ac45925039aa7a537feedab3e731e8a60a8e5 Author: Joren De Cuyper Date: Thu Jan 17 15:28:37 2013 +0100 fdo#46718 Delete multiple styles at once Change-Id: I5f5982b2a2768d021f24693a285274544e07e40f Reviewed-on: https://gerrit.libreoffice.org/1737 Reviewed-by: Radek DoulÃk Tested-by: Radek DoulÃk diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index b315453..31920f2 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -911,6 +911,7 @@ void SfxCommonTemplateDialog_Impl::Initialize() aFilterLb.SetSelectHdl( LINK( this, SfxCommonTemplateDialog_Impl, FilterSelectHdl ) ); aFmtLb.SetDoubleClickHdl( LINK( this, SfxCommonTemplateDialog_Impl, ApplyHdl ) ); aFmtLb.SetSelectHdl( LINK( this, SfxCommonTemplateDialog_Impl, FmtSelectHdl ) ); +aFmtLb.SetSelectionMode(MULTIPLE_SELECTION); aFilterLb.Show(); aFmtLb.Show(); @@ -1046,7 +1047,7 @@ void SfxCommonTemplateDialog_Impl::SelectStyle(const String &rStr) { aFmtLb.MakeVisible( pEntry ); aFmtLb.Select( pEntry ); -bWaterDisabled = !HasSelectedStyle(); +bWaterDisabled = (aFmtLb.GetSelectionCount() <=1 ? sal_False : sal_True); FmtSelectHdl( NULL ); } } @@ -1306,7 +1307,8 @@ void SfxCommonTemplateDialog_Impl::SetWaterCanState(const SfxBoolItem *pItem) bWaterDisabled = pItem == 0; if(!bWaterDisabled) -bWaterDisabled = !HasSelectedStyle(); +//make sure the watercan is only activated when there is (only) one selection +bWaterDisabled = (aFmtLb.GetSelectionCount() <=1 ? sal_False : sal_True); if(pItem && !bWaterDisabled) { @@ -1644,6 +1646,7 @@ sal_Bool SfxCommonTemplateDialog_Impl::Execute_Impl( aUpdName.SetValue(aTemplName); pItems[ nCount++ ] = &aUpdName; } + if ( rRefStr.Len() ) pItems[ nCount++ ] = &aRefName; @@ -1660,7 +1663,7 @@ sal_Bool SfxCommonTemplateDialog_Impl::Execute_Impl( if ( !pItem || aDeleted ) return sal_False; -if ( nId == SID_STYLE_NEW || SID_STYLE_EDIT == nId ) +if ( (nId == SID_STYLE_NEW || SID_STYLE_EDIT == nId) && (aFmtLb.GetSelectionCount() <= 1) ) { SfxUInt16Item *pFilterItem = PTR_CAST(SfxUInt16Item, pItem); OSL_ENSURE(pFilterItem, "SfxUINT16Item expected"); @@ -1899,7 +1902,7 @@ IMPL_LINK( SfxCommonTemplateDialog_Impl, DropHdl, StyleTreeListBox_Impl *, pBox void SfxCommonTemplateDialog_Impl::NewHdl(void *) { String aEmpty; -if ( nActFamily != 0x ) +if ( nActFamily != 0x && (aFmtLb.GetSelectionCount() <= 1)) { Window* pTmp; pTmp = Application::GetDefDialogParent(); @@ -1963,39 +1966,80 @@ void SfxCommonTemplateDialog_Impl::DeleteHdl(void *) { if ( IsInitialized() && HasSelectedStyle() ) { -const String aTemplName( GetSelectedEntry() ); -SfxStyleSheetBase* pStyle = GetSelectedStyle(); -if ( pStyle ) +sal_uLong SelectionCount = 0; +sal_Bool bChecked = 0; +String aRet; + +SelectionCount = aFmtLb.GetSelectionCount(); +std::vector aList; + +SvTreeListEntry* pEntry = aFmtLb.FirstSelected(); + +while (pEntry) { -String aMsg; -if ( pStyle->IsUsed() ) -aMsg = SfxResId(STR_DELETE_STYLE_USED).toString(); -aMsg += SfxResId(STR_DELETE_STYLE).toString(); -aMsg.SearchAndReplaceAscii( "$1", aTemplName ); -#if defined UNX -QueryBox aBox( SFX_APP()->GetTopWindow(), WB_YES_NO | WB_DEF_NO, aMsg ); -#else -QueryBox aBox( GetWindow(), WB_YES_NO | WB_DEF_NO , aMsg ); -#endif -if ( RET_YES == aBox.Execute() ) +aList.push_back( pEntry ); +pEntry = aFmtLb.NextSelected( pEntry ); +SelectionCount++; +} + +std::vector::const_iterator it = aList.begin(), itEnd = aList.end(); + +for (; it != itEnd; ++it) +{ +if (pTreeBox) +aRet = pTreeBox->GetEntryText( *it ); +else +aRet = aFmtLb.GetEntryText( *it ); +const String aTemplName( aRet ); + +const SfxStyleFamilyItem* pItem = GetFamilyItem_Impl(); + +SfxStyleSheetBase* pStyle = pStyleSheetPool->Find( aTemplName, pItem->GetFamily(), SFXSTYLEBIT_ALL ); + +bool bUsedStyle = pStyle->IsUsed(); +bool approve; + +if ( bChecked == 0 ) +{ +String aMsg; +if ( bUsedStyle ) +aMsg = SfxResId(STR_DELETE_STYLE_USED).toString(); +aMsg += SfxResId(STR_DELETE_STYLE).toString(); +aMsg.SearchA
[Libreoffice-commits] .: sfx2/source
sfx2/source/doc/guisaveas.cxx | 46 +- 1 file changed, 23 insertions(+), 23 deletions(-) New commits: commit 862f694f54db1594c24bfbed8e1e833b1c7e Author: Tor Lillqvist Date: Mon Jan 21 14:27:27 2013 +0200 Fix spelling misteak Change-Id: Ie5d3564cf00c27c11597dd3ff1ba8dc82e250c0b diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx index 6c5f2e2..d603ce5 100644 --- a/sfx2/source/doc/guisaveas.cxx +++ b/sfx2/source/doc/guisaveas.cxx @@ -298,8 +298,8 @@ public: sal_Bool ShowDocumentInfoDialog(); -::rtl::OUString GetReccomendedDir( const ::rtl::OUString& aSuggestedDir ); -::rtl::OUString GetReccomendedName( const ::rtl::OUString& aSuggestedName, +::rtl::OUString GetRecommendedDir( const ::rtl::OUString& aSuggestedDir ); +::rtl::OUString GetRecommendedName( const ::rtl::OUString& aSuggestedName, const ::rtl::OUString& aTypeName ); }; @@ -946,12 +946,12 @@ sal_Bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode, } } -::rtl::OUString aReccomendedDir = GetReccomendedDir( aSuggestedDir ); -if ( !aReccomendedDir.isEmpty() ) -pFileDlg->SetDisplayFolder( aReccomendedDir ); -::rtl::OUString aReccomendedName = GetReccomendedName( aSuggestedName, aAdjustToType ); -if ( !aReccomendedName.isEmpty() ) -pFileDlg->SetFileName( aReccomendedName ); +::rtl::OUString aRecommendedDir = GetRecommendedDir( aSuggestedDir ); +if ( !aRecommendedDir.isEmpty() ) +pFileDlg->SetDisplayFolder( aRecommendedDir ); +::rtl::OUString aRecommendedName = GetRecommendedName( aSuggestedName, aAdjustToType ); +if ( !aRecommendedName.isEmpty() ) +pFileDlg->SetFileName( aRecommendedName ); uno::Reference < view::XSelectionSupplier > xSel( GetModel()->getCurrentController(), uno::UNO_QUERY ); if ( xSel.is() && xSel->getSelection().hasValue() ) @@ -1133,9 +1133,9 @@ sal_Bool ModelData_Impl::ShowDocumentInfoDialog() } //- -::rtl::OUString ModelData_Impl::GetReccomendedDir( const ::rtl::OUString& aSuggestedDir ) +::rtl::OUString ModelData_Impl::GetRecommendedDir( const ::rtl::OUString& aSuggestedDir ) { -::rtl::OUString aReccomendedDir; +::rtl::OUString aRecommendedDir; if ( ( !aSuggestedDir.isEmpty() || GetStorable()->hasLocation() ) && !GetMediaDescr().getUnpackedValueOrDefault( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RepairPackage")), @@ -1160,36 +1160,36 @@ sal_Bool ModelData_Impl::ShowDocumentInfoDialog() aLocation.setFinalSlash(); if ( !aLocation.HasError() ) -aReccomendedDir = aLocation.GetMainURL( INetURLObject::NO_DECODE ); +aRecommendedDir = aLocation.GetMainURL( INetURLObject::NO_DECODE ); } else { -aReccomendedDir = INetURLObject( SvtPathOptions().GetWorkPath() ).GetMainURL( INetURLObject::NO_DECODE ); +aRecommendedDir = INetURLObject( SvtPathOptions().GetWorkPath() ).GetMainURL( INetURLObject::NO_DECODE ); } -return aReccomendedDir; +return aRecommendedDir; } //- -::rtl::OUString ModelData_Impl::GetReccomendedName( const ::rtl::OUString& aSuggestedName, const ::rtl::OUString& aTypeName ) +::rtl::OUString ModelData_Impl::GetRecommendedName( const ::rtl::OUString& aSuggestedName, const ::rtl::OUString& aTypeName ) { // the last used name might be provided by aSuggestedName from the old selection, or from the MediaDescriptor -::rtl::OUString aReccomendedName; +::rtl::OUString aRecommendedName; if ( !aSuggestedName.isEmpty() ) -aReccomendedName = aSuggestedName; +aRecommendedName = aSuggestedName; else { -aReccomendedName = INetURLObject( GetStorable()->getLocation() ).GetName( INetURLObject::DECODE_WITH_CHARSET ); -if ( aReccomendedName.isEmpty() ) +aRecommendedName = INetURLObject( GetStorable()->getLocation() ).GetName( INetURLObject::DECODE_WITH_CHARSET ); +if ( aRecommendedName.isEmpty() ) { try { uno::Reference< frame::XTitle > xTitle( GetModel(), uno::UNO_QUERY_THROW ); -aReccomendedName = xTitle->getTitle(); +aRecommendedName = xTitle->getTitle(); } catch( const uno::Exception& ) {} } -if ( !aReccomendedName.isEmpty() && !aTypeName.isEmpty() ) +if ( !aRecommendedName.isEmpty() && !aTypeName.isEmpty() ) { // adjust the extension to the type uno::Reference< container::XNameAccess > xTypeDetection = uno::Reference< container::XNameAccess >( @@ -1197,7 +1197,7 @@ sal_Bool ModelData_Impl::ShowDocumentInfoDialog() uno::UNO_QUERY ); if ( xTypeDetection.is() )
[Libreoffice-commits] .: sfx2/source
sfx2/source/doc/objstor.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 3495f4817b80c3fc9846ed2bddfc492d39f01679 Author: Stephan Bergmann Date: Mon Jan 14 14:11:53 2013 +0100 Work around "may be used uninitialized" warnings Change-Id: Ib31ebaf6a6117689737705921a7af558257e8cd1 diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index d646e5f..059bf5b 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -2873,8 +2873,8 @@ sal_uInt16 SfxObjectShell::GetHiddenInformationState( sal_uInt16 nStates ) sal_Int16 SfxObjectShell::QueryHiddenInformation( HiddenWarningFact eFact, Window* pParent ) { sal_Int16 nRet = RET_YES; -sal_uInt16 nResId = 0; -SvtSecurityOptions::EOption eOption; +sal_uInt16 nResId = sal_uInt16(); +SvtSecurityOptions::EOption eOption = SvtSecurityOptions::EOption(); switch ( eFact ) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/appl/appuno.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 4f6cd9a3dc5e83e7394dfb35161abb94699e59fb Author: Cédric Bosdonnat Date: Thu Jan 10 10:52:18 2013 +0100 fdo#58328: fixed items types made versioning work again Change-Id: Ib74f8f1a79ca04c42db9bd2c35ae6c4729edad69 diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx index 2e6ba66..fb16aad 100644 --- a/sfx2/source/appl/appuno.cxx +++ b/sfx2/source/appl/appuno.cxx @@ -130,8 +130,8 @@ SfxFormalArgument aFormalArgs[] = { SFX_ARGUMENT(SID_DEFAULTFILENAME,"SuggestedSaveAsName",SfxStringItem), SFX_ARGUMENT(SID_DEFAULTFILEPATH,"SuggestedSaveAsDir",SfxStringItem), SFX_ARGUMENT(SID_DOCINFO_AUTHOR,"VersionAuthor",SfxStringItem), -SFX_ARGUMENT(SID_DOCINFO_COMMENTS,"VersionComment",SfxBoolItem), -SFX_ARGUMENT(SID_DOCINFO_MAJOR,"VersionMajor",SfxStringItem), +SFX_ARGUMENT(SID_DOCINFO_COMMENTS,"VersionComment",SfxStringItem), +SFX_ARGUMENT(SID_DOCINFO_MAJOR,"VersionMajor",SfxBoolItem), SFX_ARGUMENT(SID_FILE_FILTEROPTIONS,"FilterOptions",SfxStringItem), SFX_ARGUMENT(SID_FILTER_NAME,"FilterName",SfxStringItem), //SFX_ARGUMENT(SID_FILE_NAME,"FileName",SfxStringItem), ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/doc/templatedlg.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 3c08052394409a9c8aac07557a343070235672e7 Author: Cédric Bosdonnat Date: Wed Jan 9 16:41:58 2013 +0100 Template Manager: delete popup menus in the proper order Change-Id: Iafccfaa572b945d8d75d926ccc1935320b9d70d9 diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index 9a50ba9..11fddc2 100644 --- a/sfx2/source/doc/templatedlg.cxx +++ b/sfx2/source/doc/templatedlg.cxx @@ -210,9 +210,9 @@ SfxTemplateManagerDlg::~SfxTemplateManagerDlg () delete mpSearchView; delete maView; delete mpOnlineView; +delete mpTemplateDefaultMenu; delete mpActionMenu; delete mpRepositoryMenu; -delete mpTemplateDefaultMenu; delete mpToolbars; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/control/templateabstractview.cxx |7 ++- sfx2/source/doc/templatedlg.cxx |2 ++ 2 files changed, 4 insertions(+), 5 deletions(-) New commits: commit 1ce372eec4dd0e4e807baa7bbf568245b955f99f Author: Cédric Bosdonnat Date: Wed Jan 9 15:18:17 2013 +0100 Template Manager: filter the results when opening the dialog Change-Id: If6cc5f6d5e502c1fc5da210179263be63fc8c8a6 diff --git a/sfx2/source/control/templateabstractview.cxx b/sfx2/source/control/templateabstractview.cxx index c9ea989..27d37a8 100644 --- a/sfx2/source/control/templateabstractview.cxx +++ b/sfx2/source/control/templateabstractview.cxx @@ -103,7 +103,7 @@ TemplateAbstractView::TemplateAbstractView (Window *pParent, WinBits nWinStyle, : ThumbnailView(pParent,nWinStyle,bDisableTransientChildren), mpItemView(new TemplateView(this)), mbFilteredResults(false), - meFilterOption(FILTER_APP_NONE) + meFilterOption(FILTER_APP_WRITER) { mpItemView->setItemStateHdl(LINK(this,TemplateAbstractView,OverlayItemStateHdl)); } @@ -112,7 +112,7 @@ TemplateAbstractView::TemplateAbstractView(Window *pParent, const ResId &rResId, : ThumbnailView(pParent,rResId,bDisableTransientChildren), mpItemView(new TemplateView(this)), mbFilteredResults(false), - meFilterOption(FILTER_APP_NONE) + meFilterOption(FILTER_APP_WRITER) { mpItemView->setItemStateHdl(LINK(this,TemplateAbstractView,OverlayItemStateHdl)); } @@ -186,9 +186,6 @@ void TemplateAbstractView::showOverlay (bool bVisible) if (mbFilteredResults) { filterItems(ViewFilter_Application(meFilterOption)); - -mbFilteredResults = false; -meFilterOption = FILTER_APP_NONE; } mpItemView->Clear(); diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index 4c12338..9a50ba9 100644 --- a/sfx2/source/doc/templatedlg.cxx +++ b/sfx2/source/doc/templatedlg.cxx @@ -191,6 +191,8 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent) maView->Populate(); maView->Show(); +mpCurView->filterTemplatesByApp(FILTER_APP_WRITER); + FreeResource(); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/doc/templatedlg.cxx |3 --- sfx2/source/doc/templatedlg.hrc |1 - sfx2/source/doc/templatedlg.src |5 - 3 files changed, 9 deletions(-) New commits: commit 52006aa4050a07fcc238f3cc9e1faa1ac95d08ec Author: Cédric Bosdonnat Date: Wed Jan 9 14:22:23 2013 +0100 Template Manager: removed All category Change-Id: I073b9601c82a464f705df30cfd7e760c212eb7ca diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index 6b9a2c4..4c12338 100644 --- a/sfx2/source/doc/templatedlg.cxx +++ b/sfx2/source/doc/templatedlg.cxx @@ -254,9 +254,6 @@ IMPL_LINK_NOARG(SfxTemplateManagerDlg,ActivatePageHdl) case FILTER_DRAWS: eFilter = FILTER_APP_DRAW; break; -default: -case FILTER_ALL: -; } mpCurView->filterTemplatesByApp(eFilter); return 0; diff --git a/sfx2/source/doc/templatedlg.hrc b/sfx2/source/doc/templatedlg.hrc index 02c6702..672575c 100644 --- a/sfx2/source/doc/templatedlg.hrc +++ b/sfx2/source/doc/templatedlg.hrc @@ -7,7 +7,6 @@ */ #define TAB_CONTROL 1 -#define FILTER_ALL 2 #define FILTER_DOCS 3 #define FILTER_PRESENTATIONS4 #define FILTER_SHEETS 5 diff --git a/sfx2/source/doc/templatedlg.src b/sfx2/source/doc/templatedlg.src index 2480862..a351431 100644 --- a/sfx2/source/doc/templatedlg.src +++ b/sfx2/source/doc/templatedlg.src @@ -121,11 +121,6 @@ ModelessDialog DLG_TEMPLATE_MANAGER { PageItem { -Identifier = FILTER_ALL; -Text [ en-US ] = "All"; -}; -PageItem -{ Identifier = FILTER_DOCS; Text [ en-US ] = "Documents"; }; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/control/thumbnailview.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit f10a3305473c83893a2c3062ce9fb8c9146fd1dc Author: Cédric Bosdonnat Date: Tue Jan 8 16:45:20 2013 +0100 Template Manager: clicking on selected item should deselect it Change-Id: Id13ce13ec222fc10cbfcad7fec5e7eeb5957312c diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx index 61cb3f2..0e47fb7 100644 --- a/sfx2/source/control/thumbnailview.cxx +++ b/sfx2/source/control/thumbnailview.cxx @@ -503,7 +503,7 @@ void ThumbnailView::MouseButtonDown( const MouseEvent& rMEvt ) { if (!pItem->isSelected() && !rMEvt.IsMod1()) deselectItems( ); -pItem->setSelection(!pItem->isSelected()); +pItem->setSelection(true); if (!pItem->isHighlighted()) DrawItem(pItem); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/control/thumbnailview.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit 49d7492e1dd89c52b798e5ac8ab01d4a0f771a35 Author: Cédric Bosdonnat Date: Tue Jan 8 16:18:24 2013 +0100 Template Manager: clicking on empty space deselect everything Change-Id: I7cfbbd3a4f4283b9438a97eb383b460cad1f5a63 diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx index 618d7f2..61cb3f2 100644 --- a/sfx2/source/control/thumbnailview.cxx +++ b/sfx2/source/control/thumbnailview.cxx @@ -525,6 +525,8 @@ void ThumbnailView::MouseButtonDown( const MouseEvent& rMEvt ) return; } +else if (!pItem) +deselectItems( ); } Control::MouseButtonDown( rMEvt ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/control/thumbnailview.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 59555e5b38d62b92397d7f3eac5097211ed261c4 Author: Cédric Bosdonnat Date: Tue Jan 8 16:05:48 2013 +0100 Template Manager: unselect folder when double-clicking Change-Id: I11ad88b3a69d3e2a00e859ee33cbc22c5d525618 diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx index b9b0e89..618d7f2 100644 --- a/sfx2/source/control/thumbnailview.cxx +++ b/sfx2/source/control/thumbnailview.cxx @@ -513,7 +513,7 @@ void ThumbnailView::MouseButtonDown( const MouseEvent& rMEvt ) else if ( rMEvt.GetClicks() == 2 ) { // The mouse button down event 1 click right before is pointless -pItem->setSelection(!pItem->isSelected()); +pItem->setSelection(false); maItemStateHdl.Call(pItem); Rectangle aRect(pItem->getDrawArea()); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/view/viewprn.cxx | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) New commits: commit 446ac227bf3477ac3041d87bd0d880c3d61f4208 Author: Noel Power Date: Thu Jan 3 13:46:38 2013 + fix fdo#58779 fdo#58403 re. raise print dialog adds another tweak that had been removed with some print related rewrite Change-Id: If63072c9b2c6158d46f26933fd54766fd808569c diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index 2b2f119..6a0a9fa 100644 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -682,6 +682,13 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) if ( !bSilent && pDoc->QueryHiddenInformation( WhenPrinting, NULL ) != RET_YES ) return; +// should we print only the selection or the whole document +SFX_REQUEST_ARG(rReq, pSelectItem, SfxBoolItem, SID_SELECTION, sal_False); +sal_Bool bSelection = ( pSelectItem != NULL && pSelectItem->GetValue() ); +// detect non api call from writer ( that adds SID_SELECTION ) and reset bIsAPI +if ( pSelectItem && rReq.GetArgs()->Count() == 1 ) +bIsAPI = sal_False; + uno::Sequence < beans::PropertyValue > aProps; if ( bIsAPI ) { @@ -739,10 +746,6 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) // it would be better if writer handled this internally if( nId == SID_PRINTDOCDIRECT ) { -// should we print only the selection or the whole document -SFX_REQUEST_ARG(rReq, pSelectItem, SfxBoolItem, SID_SELECTION, sal_False); -sal_Bool bSelection = ( pSelectItem != NULL && pSelectItem->GetValue() ); - aProps[nLen].Name = rtl::OUString( "PrintSelectionOnly" ); aProps[nLen].Value = makeAny( bSelection ); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/view/viewprn.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 6c336f4e07835f3f7969531f5fc69c6ac153920a Author: Noel Power Date: Thu Dec 20 19:30:23 2012 + fix fdo#58403 fix processing of arguments from ".uno:Print" request Change-Id: I011c2ea45d33ead14910e149a99ee8e587ef79b9 diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index 4902d90..a001557 100644 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -653,7 +653,7 @@ void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq ) boolbSilent = false; // does the function have been called by the user interface or by an API call -sal_Bool bIsAPI = rReq.IsAPI(); +sal_Bool bIsAPI = rReq.GetArgs() && rReq.GetArgs()->Count(); if ( bIsAPI ) { // the function have been called by the API ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/appl/appserv.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 3b87d3dd507cd48286160e62383f48e2f70f0067 Author: Rob Snelders Date: Tue Dec 18 22:36:14 2012 +0100 fdo#58370 - 'Send Feedback...' URL invalid in other languages then English Change-Id: Idfd689c86700fe3b6ec2af477973a2cb484fc29d Reviewed-on: https://gerrit.libreoffice.org/1408 Reviewed-by: Kohei Yoshida Tested-by: Kohei Yoshida diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index b190c52..fd224a5 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -477,8 +477,8 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) case SID_SEND_FEEDBACK: { ::rtl::OUString module = SfxHelp::GetCurrentModuleIdentifier(); -::rtl::OUString sURL("http://hub.libreoffice.org/send-feedback/?version="; + utl::ConfigManager::getAboutBoxProductVersion() + -"&locale=" + utl::ConfigManager::getLocale() + "&module=" + module.copy(module.lastIndexOf(".") + 1 ) ); +::rtl::OUString sURL("http://hub.libreoffice.org/send-feedback/?LOversion="; + utl::ConfigManager::getAboutBoxProductVersion() + +"&LOlocale=" + utl::ConfigManager::getLocale() + "&LOmodule=" + module.copy(module.lastIndexOf(".") + 1 ) ); try { uno::Reference< com::sun::star::system::XSystemShellExecute > xSystemShellExecute( ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/doc/templatedlg.src |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit af0a4a7a4efe19c88cf7cf567f49abe21a69df3d Author: Cédric Bosdonnat Date: Thu Dec 13 16:07:29 2012 +0100 Template Manager: fixed typo in .src file Change-Id: I27195076b6a0a8f48c676d884d671fc9a746ce6b diff --git a/sfx2/source/doc/templatedlg.src b/sfx2/source/doc/templatedlg.src index a9a844c..2480862 100644 --- a/sfx2/source/doc/templatedlg.src +++ b/sfx2/source/doc/templatedlg.src @@ -107,7 +107,7 @@ ModelessDialog DLG_TEMPLATE_MANAGER SVLook = TRUE; Moveable = TRUE; Closeable = TRUE; -Resizeable = TRUE; +Sizeable = TRUE; Hide = TRUE; Size = MAP_APPFONT ( 290 , 250 ); Text [en-US] = "Template Manager"; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/dialog/taskpane.cxx |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) New commits: commit 8a4db529db50dca5df7b56f770fce2da7725fdda Author: Rob Snelders Date: Mon Dec 3 22:49:37 2012 +0100 fdo#31309 Taskpane items visibility can't be restored Change-Id: I9959b8e0a21252638a4f39f88bf5049ea905f4bb Reviewed-on: https://gerrit.libreoffice.org/1231 Reviewed-by: Lennard Wasserthal Reviewed-by: Kohei Yoshida Tested-by: Kohei Yoshida diff --git a/sfx2/source/dialog/taskpane.cxx b/sfx2/source/dialog/taskpane.cxx index a92d27e..cdc6f22 100644 --- a/sfx2/source/dialog/taskpane.cxx +++ b/sfx2/source/dialog/taskpane.cxx @@ -958,15 +958,16 @@ namespace sfx2 TaskPaneController_Impl::~TaskPaneController_Impl() { m_rTaskPane.GetPanelDeck().RemoveListener( *this ); +int i = 0; // remove the panels which are not under the control of the panel deck currently for ( PanelDescriptors::iterator panelPos = m_aPanelRepository.begin(); panelPos != m_aPanelRepository.end(); -++panelPos +++panelPos, ++i ) { if ( panelPos->bHidden ) -panelPos->pPanel->Dispose(); +impl_togglePanelVisibility( i ); } m_aPanelRepository.clear(); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/doc/doctemplates.cxx |5 ++--- sfx2/source/doc/guisaveas.cxx|2 +- sfx2/source/doc/objcont.cxx |2 +- sfx2/source/doc/objstor.cxx |3 --- 4 files changed, 4 insertions(+), 8 deletions(-) New commits: commit 6a7371d266b7050a9c07b3abce84ef23904525ac Author: Caolán McNamara Date: Fri Dec 7 09:47:37 2012 + loplugin: various unused variables Change-Id: I59cfea1b755fb4da5cdc9032e719e4e1579a906e diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index 1313fee..49e71cd 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -444,7 +444,7 @@ void SfxDocTplService_Impl::init_Impl() m_xDocProps.set(document::DocumentProperties::create( ::comphelper::getProcessComponentContext())); } catch (uno::RuntimeException const& e) { -SAL_WARN("sfx.doc", "SfxDocTplService_Impl::init_Impl: " +SAL_WARN("sfx2.doc", "SfxDocTplService_Impl::init_Impl: " "cannot create DocumentProperties service:" << e.Message); } @@ -1903,7 +1903,6 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName, aStoreArgs[1].Name = ::rtl::OUString("DocumentTitle"); aStoreArgs[1].Value <<= rTemplateName; -::rtl::OUString aCurrentDocumentURL = rStorable->getLocation(); if( !::utl::UCBContentHelper::EqualURLs( aNewTemplateTargetURL, rStorable->getLocation() )) rStorable->storeToURL( aNewTemplateTargetURL, aStoreArgs ); else @@ -1987,7 +1986,7 @@ sal_Bool SfxDocTplService_Impl::addTemplate( const OUString& rGroupName, } // Get the content type -OUString aTitle, aType, aTargetURL2, aFullName; +OUString aTitle, aType, aTargetURL2; sal_Bool bDocHasTitle = sal_False; if( !getTitleFromURL( rSourceURL, aTitle, aType, bDocHasTitle ) ) diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx index c6af316..6c5f2e2 100644 --- a/sfx2/source/doc/guisaveas.cxx +++ b/sfx2/source/doc/guisaveas.cxx @@ -1734,7 +1734,7 @@ void SfxStoringHelper::SetDocInfoState( } catch (const uno::Exception& e) { -SAL_INFO("sfx.doc", "SetDocInfoState: caught exception: " << e.Message); +SAL_INFO("sfx2.doc", "SetDocInfoState: caught exception: " << e.Message); } // set the modified flag back if required diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx index c532a31..118851e 100644 --- a/sfx2/source/doc/objcont.cxx +++ b/sfx2/source/doc/objcont.cxx @@ -907,7 +907,7 @@ void SfxObjectShell::UpdateFromTemplate_Impl( ) } catch (const Exception& e) { -SAL_INFO("sfx.doc", "caught exception" << e.Message); +SAL_INFO("sfx2.doc", "caught exception" << e.Message); } // if modify date was read successfully diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 88380bb..887be25 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -1469,7 +1469,6 @@ sal_Bool SfxObjectShell::SaveTo_Impl aInfo.Comment = pVersionItem->GetValue(); // version author -String aAuthor; if ( pAuthorItem ) aInfo.Author = pAuthorItem->GetValue(); else @@ -2133,7 +2132,6 @@ sal_Bool SfxObjectShell::ConvertFrom sal_Bool SfxObjectShell::ImportFrom( SfxMedium& rMedium, bool bInsert ) { -::rtl::OUString aTypeName( rMedium.GetFilter()->GetTypeName() ); ::rtl::OUString aFilterName( rMedium.GetFilter()->GetFilterName() ); uno::Reference< lang::XMultiServiceFactory > xMan = ::comphelper::getProcessServiceFactory(); @@ -2244,7 +2242,6 @@ sal_Bool SfxObjectShell::ImportFrom( SfxMedium& rMedium, bool bInsert ) sal_Bool SfxObjectShell::ExportTo( SfxMedium& rMedium ) { -::rtl::OUString aTypeName( rMedium.GetFilter()->GetTypeName() ); ::rtl::OUString aFilterName( rMedium.GetFilter()->GetFilterName() ); uno::Reference< document::XExporter > xExporter; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/control/templateabstractview.cxx | 29 --- 1 file changed, 26 insertions(+), 3 deletions(-) New commits: commit e2a35977ca056d7bf1dae3a9c41ae135a85892fd Author: Cédric Bosdonnat Date: Wed Dec 5 18:40:16 2012 +0100 Template manager: keep thumbnails ratio when scaling down Change-Id: Ic597dd9fd12895c0d21f678cba44feba9f6fcd47 diff --git a/sfx2/source/control/templateabstractview.cxx b/sfx2/source/control/templateabstractview.cxx index 8cbf60f..0baed64 100644 --- a/sfx2/source/control/templateabstractview.cxx +++ b/sfx2/source/control/templateabstractview.cxx @@ -137,10 +137,33 @@ BitmapEx TemplateAbstractView::scaleImg (const BitmapEx &rImg, long width, long { BitmapEx aImg = rImg; -int sWidth = std::min(aImg.GetSizePixel().getWidth(),width); -int sHeight = std::min(aImg.GetSizePixel().getHeight(),height); +if ( !rImg.IsEmpty() ) +{ + +const Size& aImgSize = aImg.GetSizePixel(); +double nRatio = double(aImgSize.getWidth()) / double(aImgSize.getHeight()); + +long nDestWidth = aImgSize.getWidth(); +long nDestHeight = aImgSize.getHeight(); + +// Which one side is the overflowing most? +long nDistW = aImgSize.getWidth() - width; +long nDistH = aImgSize.getHeight() - height; + +// Use the biggest overflow side to make it fit the destination +if ( nDistW >= nDistH && nDistW > 0 ) +{ +nDestWidth = width; +nDestHeight = width / nRatio; +} +else if ( nDistW < nDistH && nDistH > 0 ) +{ +nDestHeight = height; +nDestWidth = height * nRatio; +} -aImg.Scale(Size(sWidth,sHeight),BMP_SCALE_INTERPOLATE); +aImg.Scale(Size(nDestWidth,nDestHeight)); +} return aImg; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/doc/doctemplates.cxx |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit d43d756500114738ac845c6e24cba8c897ed659d Author: Tor Lillqvist Date: Mon Dec 3 15:07:18 2012 +0200 WaE: BaseReference::_pInterface may be used uninitialized in this function Change-Id: I061dc4ee8c8fb5b369e3ed78f0fba136ef8b02d0 diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index a724dea..1313fee 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -1857,7 +1857,9 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName, throw uno::RuntimeException(); // find the mediatype and extension -uno::Reference< container::XNameAccess > xTypeDetection = +uno::Reference< container::XNameAccess > xTypeDetection; + +xTypeDetection = mxType.is() ? uno::Reference< container::XNameAccess >( mxType, uno::UNO_QUERY_THROW ) : uno::Reference< container::XNameAccess >( ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/appl/appserv.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 7226672d4b894192d5312885c1c13a6394c27187 Author: Rob Snelders Date: Wed Nov 28 18:35:45 2012 +0100 rename the URL for feedback to something more positive Change-Id: Iea248eeb3c3eacf9b0f123daa52516f5c1f0259c diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 269dcbf..744a0ef 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -424,7 +424,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) case SID_SEND_FEEDBACK: { ::rtl::OUString module = SfxHelp::GetCurrentModuleIdentifier(); -::rtl::OUString sURL("http://hub.libreoffice.org/file-a-bug/?version="; + utl::ConfigManager::getAboutBoxProductVersion() + +::rtl::OUString sURL("http://hub.libreoffice.org/send-feedback/?version="; + utl::ConfigManager::getAboutBoxProductVersion() + "&locale=" + utl::ConfigManager::getLocale() + "&module=" + module.copy(module.lastIndexOf(".") + 1 ) ); try { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/appl/appserv.cxx |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit 80086a82883239cad5a6e667c8ff174623e190a2 Author: Rob Snelders Date: Fri Nov 23 22:58:34 2012 +0100 Get more information to the BSA from the send feedback-menuitem Change-Id: I77b3afa52bd5cc25a6385cbdb480a30e7aef387c diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 3e0a297..269dcbf 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -423,7 +423,9 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) case SID_SEND_FEEDBACK: { -::rtl::OUString sURL("http://hub.libreoffice.org/file-a-bug/";); +::rtl::OUString module = SfxHelp::GetCurrentModuleIdentifier(); +::rtl::OUString sURL("http://hub.libreoffice.org/file-a-bug/?version="; + utl::ConfigManager::getAboutBoxProductVersion() + +"&locale=" + utl::ConfigManager::getLocale() + "&module=" + module.copy(module.lastIndexOf(".") + 1 ) ); try { uno::Reference< com::sun::star::system::XSystemShellExecute > xSystemShellExecute( ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/appl/linkmgr2.cxx |5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) New commits: commit 21675d2d49be13ba48d4fb444b618944a454bd9c Author: Eike Rathke Date: Sat Nov 17 00:39:07 2012 +0100 use LanguageTag Change-Id: Ie060f2357a17be818d34c9393ac4ac606331d081 diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx index 9564a18..4f8a7a2 100644 --- a/sfx2/source/appl/linkmgr2.cxx +++ b/sfx2/source/appl/linkmgr2.cxx @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include "fileobj.hxx" @@ -608,8 +608,7 @@ sal_Bool SvxInternalLink::Connect( sfx2::SvBaseLink* pLink ) { // first only loop over the DocumentShells the shells and find those // with the name: -com::sun::star::lang::Locale aLocale; -MsLangId::convertLanguageToLocale( LANGUAGE_SYSTEM, aLocale ); +com::sun::star::lang::Locale aLocale( LanguageTag( LANGUAGE_SYSTEM).getLocale()); CharClass aCC( aLocale ); TypeId aType( TYPE(SfxObjectShell) ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/doc/templatedlg.src |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 1d4e242b9edd30e38794d22972c3f5527a5340db Author: Stefan Knorr Date: Sun Nov 11 20:02:45 2012 +0100 Correct typo in new template dialog: Spreedsheet -> Spreadsheet Change-Id: If0dc7cf7694a2e11839d033b98603263f7600896 Reviewed-on: https://gerrit.libreoffice.org/1039 Reviewed-by: Markus Mohrhard Tested-by: Markus Mohrhard diff --git a/sfx2/source/doc/templatedlg.src b/sfx2/source/doc/templatedlg.src index 4098472..c81c507 100644 --- a/sfx2/source/doc/templatedlg.src +++ b/sfx2/source/doc/templatedlg.src @@ -140,7 +140,7 @@ ModelessDialog DLG_TEMPLATE_MANAGER Pos = MAP_APPFONT(160,5); Size = MAP_APPFONT(50,14); TabStop = TRUE; -Text [en-US] = "Spreedsheets"; +Text [en-US] = "Spreadsheets"; }; PushButton BTN_SELECT_DRAWS ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/bastyp/fltfnc.cxx |1 - sfx2/source/control/dispatch.cxx|2 -- sfx2/source/dialog/dinfdlg.cxx |5 - sfx2/source/dialog/securitypage.cxx |5 - 4 files changed, 13 deletions(-) New commits: commit a599f5b4b51848e3b397d471c9d12b373caadcef Author: jailletc36 Date: Thu Nov 8 07:25:02 2012 +0100 cppCheck: Unused variable and Redundant assignment Change-Id: I67084c1cb9dc23eb77787d2a6d57a5b70126873c Signed-off-by: jailletc36 Reviewed-on: https://gerrit.libreoffice.org/1005 Reviewed-by: Radek DoulÃk Tested-by: Radek DoulÃk diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx index 14df8c4..60de316 100644 --- a/sfx2/source/bastyp/fltfnc.cxx +++ b/sfx2/source/bastyp/fltfnc.cxx @@ -1147,7 +1147,6 @@ void SfxFilterContainer::ReadFilters_Impl( sal_Bool bUpdate ) SfxFilter* pFilter; for ( size_t i = 0, n = rList.size(); i < n; ++i ) { -pFilter = NULL; pFilter = rList[ i ]; pFilter->nFormatType |= SFX_FILTER_NOTINSTALLED; } diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx index 069273e..935077c 100644 --- a/sfx2/source/control/dispatch.cxx +++ b/sfx2/source/control/dispatch.cxx @@ -2073,7 +2073,6 @@ SfxPopupMenuManager* SfxDispatcher::Popup( sal_uInt16 nConfigId,Window *pWin, co SfxDispatcher &rDisp = *SFX_APP()->GetDispatcher_Impl(); sal_uInt16 nShLevel = 0; SfxShell *pSh; -nShLevel=0; if ( rDisp.pImp->bQuiet ) { @@ -2101,7 +2100,6 @@ void SfxDispatcher::ExecutePopup( sal_uInt16 nConfigId, Window *pWin, const Poin sal_uInt16 nShLevel = 0; SfxShell *pSh; -nShLevel=0; if ( rDisp.pImp->bQuiet ) { nConfigId = 0; diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index ee59b5e..99d7dbf 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -2321,11 +2321,6 @@ CustomPropertiesControl::CustomPropertiesControl( Window* pParent, const ResId& m_aVertScroll.SetPageSize( nVisibleEntries - 1 ); m_aVertScroll.SetVisibleSize( nVisibleEntries ); -Point aPos = m_aHeaderBar.GetPosPixel(); -Size aSize = m_aHeaderBar.GetSizePixel(); -aPos = m_aVertScroll.GetPosPixel(); -aSize = m_aVertScroll.GetSizePixel(); - Link aScrollLink = LINK( this, CustomPropertiesControl, ScrollHdl ); m_aVertScroll.SetScrollHdl( aScrollLink ); } diff --git a/sfx2/source/dialog/securitypage.cxx b/sfx2/source/dialog/securitypage.cxx index ffa3a7a..b4de6af 100644 --- a/sfx2/source/dialog/securitypage.cxx +++ b/sfx2/source/dialog/securitypage.cxx @@ -200,11 +200,6 @@ SfxSecurityPage_Impl::SfxSecurityPage_Impl( SfxSecurityPage &rTabPage, const Sfx m_bEndRedliningWarningDone ( false ) { m_aChangeProtectionPB.SetText( m_aProtectSTR ); -// adjust button width if necessary -long nBtnTextWidth = 0; -long nTemp = m_aChangeProtectionPB.GetCtrlTextWidth( m_aChangeProtectionPB.GetText() ); -if (nTemp > nBtnTextWidth) -nBtnTextWidth = nTemp; // force toggle hdl called before visual change of checkbox m_aRecordChangesCB.SetStyle( m_aRecordChangesCB.GetStyle() | WB_EARLYTOGGLE ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source ucb/source
sfx2/source/appl/app.hrc |1 sfx2/source/appl/app.src |7 + sfx2/source/doc/objserv.cxx |5 +++- ucb/source/ucp/cmis/cmis_content.cxx | 41 +-- 4 files changed, 33 insertions(+), 21 deletions(-) New commits: commit bce042ca83c7cb5cc3e3bdc07c50b60e6a1ed659 Author: Cédric Bosdonnat Date: Sat Nov 3 14:55:19 2012 +0100 CMIS: added confirmation dialog for cancel checkout Change-Id: I12317bd8c91756c7960f04d2fad38dd509840932 diff --git a/sfx2/source/appl/app.hrc b/sfx2/source/appl/app.hrc index 5cbfd7f..fb322cb 100644 --- a/sfx2/source/appl/app.hrc +++ b/sfx2/source/appl/app.hrc @@ -112,6 +112,7 @@ #define RID_XMLSEC_QUERY_LOSINGSIGNATURE(RID_SFX_APP_START + 186) #define RID_XMLSEC_QUERY_SAVEBEFORESIGN (RID_SFX_APP_START + 187) +#define RID_QUERY_CANCELCHECKOUT(RID_SFX_APP_START + 188) #define RID_XMLSEC_INFO_WRONGDOCFORMAT (RID_SFX_APP_START + 190) diff --git a/sfx2/source/appl/app.src b/sfx2/source/appl/app.src index 6eae48d..d1dcccd 100644 --- a/sfx2/source/appl/app.src +++ b/sfx2/source/appl/app.src @@ -432,6 +432,13 @@ QueryBox RID_XMLSEC_QUERY_SAVEBEFORESIGN Message [ en-US ] = "The document has to be saved before it can be signed.\nDo you want to save the document?" ; }; +QueryBox RID_QUERY_CANCELCHECKOUT +{ +Buttons = WB_YES_NO ; +DefButton = WB_DEF_YES ; +Message [ en-US ] = "This will discard all changes on the server since check-out.\nDo you want to proceed?" ; +}; + InfoBox RID_XMLSEC_INFO_WRONGDOCFORMAT { Message [ en-US ] = "This document must be saved in OpenDocument file format before it can be digitally signed." ; diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index 116f976..490a72b 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -951,7 +951,10 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) } case SID_CANCELCHECKOUT: { -CancelCheckOut( ); +if ( QueryBox( NULL, SfxResId( RID_QUERY_CANCELCHECKOUT ) ).Execute( ) == RET_YES ) +{ +CancelCheckOut( ); +} break; } case SID_CHECKIN: diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx index 0c6ba36..83551b2 100644 --- a/ucb/source/ucp/cmis/cmis_content.cxx +++ b/ucb/source/ucp/cmis/cmis_content.cxx @@ -837,9 +837,9 @@ namespace cmis // Get the Original document (latest version) vector< libcmis::DocumentPtr > aVersions = pPwc->getAllVersions( ); -libcmis::DocumentPtr pDoc; +bool bFound = false; for ( vector< libcmis::DocumentPtr >::iterator it = aVersions.begin(); -it != aVersions.end( ) && pDoc != NULL; ++it ) +it != aVersions.end( ) && !bFound; ++it ) { libcmis::DocumentPtr pVersion = *it; map< string, libcmis::PropertyPtr > aProps = pVersion->getProperties( ); @@ -851,25 +851,26 @@ namespace cmis } if ( bIsLatestVersion ) -pDoc.reset( pVersion.get( ) ); -} - -// Compute the URL of the Document -URL aCmisUrl( m_sURL ); -vector< string > aPaths = pDoc->getPaths( ); -if ( !aPaths.empty() ) -{ -string sPath = aPaths.front( ); -aCmisUrl.setObjectPath( STD_TO_OUSTR( sPath ) ); -} -else -{ -// We may have unfiled doc depending on the server, those -// won't have any path, use their ID instead -string sId = pDoc->getId( ); -aCmisUrl.setObjectId( STD_TO_OUSTR( sId ) ); +{ +bFound = true; +// Compute the URL of the Document +URL aCmisUrl( m_sURL ); +vector< string > aPaths = pVersion->getPaths( ); +if ( !aPaths.empty() ) +{ +string sPath = aPaths.front( ); +aCmisUrl.setObjectPath( STD_TO_OUSTR( sPath ) ); +} +else +{ +// We may have unfiled doc depending on the server, those +// won't have any path, use their ID instead +string sId = pVersion->getId( ); +aCmisUrl.setObjectId( STD_TO_OUSTR( sId ) ); +} +aRet = aCmisUrl.asString( ); +} } -aRet = aCmisUrl.asString( ); } catch ( const libcmis::Exception& e ) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.free
[Libreoffice-commits] .: sfx2/source
sfx2/source/dialog/tabdlg.cxx | 17 ++--- 1 file changed, 6 insertions(+), 11 deletions(-) New commits: commit bd2c14ec78a7549d4a19738154cdd5ea890f61c4 Author: Caolán McNamara Date: Tue Oct 30 12:00:01 2012 + we have to have all tabpages in all modes now Change-Id: I05a587d4b0556cb9eda49583441b3f57d923a800 diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx index b137cee..eda2375 100644 --- a/sfx2/source/dialog/tabdlg.cxx +++ b/sfx2/source/dialog/tabdlg.cxx @@ -727,19 +727,14 @@ sal_Bool SfxTabDialog::IsApplyButtonEnabled() const void SfxTabDialog::Start_Impl() { -//If we're layout enabled, we need to force all tabs to -//exist to get overall optimal size for dialog -if (isLayoutEnabled()) +//We need to force all tabs to exist to get overall optimal size for dialog +for (sal_uInt16 n=0; n < m_pTabCtrl->GetPageCount(); ++n) { -for ( sal_uInt16 n=0; n < m_pTabCtrl->GetPageCount(); ++n) +sal_uInt16 nPageId = m_pTabCtrl->GetPageId(n); +if (!m_pTabCtrl->GetTabPage(nPageId)) { -sal_uInt16 nPageId = m_pTabCtrl->GetPageId(n); -TabPage* pTabPage = m_pTabCtrl->GetTabPage(nPageId); -if (!pTabPage) -{ -m_pTabCtrl->SetCurPageId(nPageId); -ActivatePageHdl(m_pTabCtrl); -} +m_pTabCtrl->SetCurPageId(nPageId); +ActivatePageHdl(m_pTabCtrl); } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/view/viewsh.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 22a550690bc7643ba1157543e15907ebba9444a0 Author: Caolán McNamara Date: Sun Oct 14 14:33:21 2012 +0100 Related: fdo#47250 catch harder Change-Id: Ie6b26670a6809fc07b344660111be44cb3e6a011 diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index c61e300..f6c2eb5 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -2050,7 +2050,7 @@ sal_Bool SfxViewShell::TryContextMenuInterception( Menu& rIn, const ::rtl::OUStr continue; } } -catch (const uno::RuntimeException&) +catch (...) { aIt.remove(); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/doc/templatedlg.cxx |2 -- 1 file changed, 2 deletions(-) New commits: commit 581438a0c609c957e2db0b262b3bea83fa387eac Author: Caolán McNamara Date: Fri Oct 12 13:03:42 2012 +0100 lcl_createTemplate declared but not defined Change-Id: I755853c326c5e3dbeae18e3fdb9f7b5607aac874 diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index c79c779..ca5e0b3 100644 --- a/sfx2/source/doc/templatedlg.cxx +++ b/sfx2/source/doc/templatedlg.cxx @@ -64,8 +64,6 @@ using namespace ::com::sun::star::frame; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::ui::dialogs; -static void lcl_createTemplate(uno::Reference xDesktop, const FILTER_APPLICATION eApp); - static bool lcl_getServiceName (const OUString &rFileURL, OUString &rName ); static std::vector lcl_getAllFactoryURLs (); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/dialog/tabdlg.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit bf59cceafd05dba74e4fc3a3f5fdc8098bb1a95b Author: Caolán McNamara Date: Tue Oct 9 22:02:44 2012 +0100 fix blank dialogs: now need to explicitly call show on containers Change-Id: I803f808e7049777ec5a46dc2fce00a3943321ffa diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx index 5d883c7..b137cee 100644 --- a/sfx2/source/dialog/tabdlg.cxx +++ b/sfx2/source/dialog/tabdlg.cxx @@ -592,6 +592,8 @@ void SfxTabDialog::Init_Impl( sal_Bool bFmtFlag, const String* pUserButtonText, LINK( this, SfxTabDialog, ActivatePageHdl ) ); m_pTabCtrl->SetDeactivatePageHdl( LINK( this, SfxTabDialog, DeactivatePageHdl ) ); +m_pActionArea->Show(); +m_pVBox->Show(); m_pTabCtrl->Show(); m_pOKBtn->Show(); m_pCancelBtn->Show(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/doc/docfile.cxx |1 + sfx2/source/doc/doctemplates.cxx |3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) New commits: commit 1f79b55bcabe2a627573e711a04d413d478c5882 Author: Julien Nabet Date: Sun Oct 7 17:09:36 2012 +0200 Some cppcheck cleaning Change-Id: I9ce4af18d1cdbf694093309a026fd6c738590b82 diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 9c199ad..995be9c 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -325,6 +325,7 @@ SfxMedium_Impl::SfxMedium_Impl( SfxMedium* pAntiImplP ) : bIsStorage( false ), bUseInteractionHandler( true ), bAllowDefaultIntHdl( false ), +bDisposeStorage( false ), bStorageBasedOnInStream( false ), m_bSalvageMode( false ), m_bVersionsAlreadyLoaded( false ), diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index 76a4f5d..e1f1986 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -618,12 +618,11 @@ void SfxDocTplService_Impl::getDirList() sal_Bool SfxDocTplService_Impl::needsUpdate() { OUString aPropName( PROPERTY_NEEDSUPDATE ); -sal_Bool bHasProperty = sal_False; sal_Bool bNeedsUpdate = sal_True; Any aValue; // Get the template dir list -bHasProperty = getProperty( maRootContent, aPropName, aValue ); +sal_Bool bHasProperty = getProperty( maRootContent, aPropName, aValue ); if ( bHasProperty ) aValue >>= bNeedsUpdate; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/appl/app.cxx | 33 - sfx2/source/appl/appserv.cxx |7 ++- 2 files changed, 30 insertions(+), 10 deletions(-) New commits: commit 5c02bb0f022ae6f51ccc07452901ad45a9a243e9 Author: Tor Lillqvist Date: Sun Oct 7 11:50:10 2012 +0300 DISABLE_DYNLOADING fixes and minor cleanup Change-Id: I08ce3523f259b1ace7c2a1a58b091b43a44a7d92 diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx index 3aa48ab..a4ffed8 100644 --- a/sfx2/source/appl/app.cxx +++ b/sfx2/source/appl/app.cxx @@ -468,17 +468,22 @@ void SfxApplication::Invalidate( sal_uInt16 nId ) Invalidate_Impl( pFrame->GetBindings(), nId ); } -#define DOSTRING( x ) #x -#define STRING( x ) DOSTRING( x ) - #ifndef DISABLE_SCRIPTING +#ifndef DISABLE_DYNLOADING + typedef long (SAL_CALL *basicide_handle_basic_error)(void*); -typedef rtl_uString* (SAL_CALL *basicide_choose_macro)(void*, sal_Bool, rtl_uString*); typedef void* (SAL_CALL *basicide_macro_organizer)(sal_Int16); extern "C" { static void SAL_CALL thisModule() {} } +#else + +extern "C" long basicide_handle_basic_error(void*); +extern "C" void *basicide_macro_organizer(sal_Int16); + +#endif + #endif IMPL_LINK( SfxApplication, GlobalBasicErrorHdl_Impl, StarBASIC*, pStarBasic ) @@ -487,6 +492,8 @@ IMPL_LINK( SfxApplication, GlobalBasicErrorHdl_Impl, StarBASIC*, pStarBasic ) (void) pStarBasic; return 0; #else + +#ifndef DISABLE_DYNLOADING // get basctl dllname static ::rtl::OUString aLibName( SVLIBRARY( "basctl" ) ); @@ -501,7 +508,14 @@ IMPL_LINK( SfxApplication, GlobalBasicErrorHdl_Impl, StarBASIC*, pStarBasic ) // call basicide_handle_basic_error in basctl long nRet = pSymbol ? pSymbol( pStarBasic ) : 0; +#else + +long nRet = basicide_handle_basic_error( pStarBasic ); + +#endif + return nRet; + #endif } @@ -586,6 +600,8 @@ void SfxApplication::MacroOrganizer( sal_Int16 nTabId ) #ifdef DISABLE_SCRIPTING (void) nTabId; #else + +#ifndef DISABLE_DYNLOADING // get basctl dllname static ::rtl::OUString aLibName( SVLIBRARY( "basctl" ) ); @@ -597,8 +613,15 @@ void SfxApplication::MacroOrganizer( sal_Int16 nTabId ) ::rtl::OUString aSymbol( "basicide_macro_organizer" ); basicide_macro_organizer pSymbol = (basicide_macro_organizer) osl_getFunctionSymbol( handleMod, aSymbol.pData ); -// call basicide_choose_macro in basctl +// call basicide_macro_organizer in basctl pSymbol( nTabId ); + +#else + +basicide_macro_organizer( nTabId ); + +#endif + #endif } diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 08d0352..450da3e 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -836,14 +836,11 @@ void SfxApplication::MiscState_Impl(SfxItemSet &rSet) #ifndef DISABLE_SCRIPTING +#ifndef DISABLE_DYNLOADING + typedef rtl_uString* (SAL_CALL *basicide_choose_macro)(XModel*, sal_Bool, rtl_uString*); typedef void (SAL_CALL *basicide_macro_organizer)( sal_Int16 ); -#define DOSTRING( x ) #x -#define STRING( x ) DOSTRING( x ) - -#ifndef DISABLE_DYNLOADING - extern "C" { static void SAL_CALL thisModule() {} } #else ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source unotools/inc unotools/source
sfx2/source/appl/childwin.cxx |2 - unotools/inc/unotools/viewoptions.hxx |7 + unotools/source/config/viewoptions.cxx | 40 +++-- 3 files changed, 41 insertions(+), 8 deletions(-) New commits: commit 9db74c6133ede2a28af077fd563398176ff0d858 Author: Stephan Bergmann Date: Fri Oct 5 15:00:39 2012 +0200 fdo#46071: Do not hide windows based on nil "Visible" property This appears to be messy: The /org.openoffice.Office.Views/WindowType configuration group template has both a nilable bool "Visible" property and a UserData/Data string property that encodes various things like geometry---but also visibility---in a string. Now, likely due to the problem that has meanwhile been fixed through f3f79cc9e6c265baf48955d53f7e888205e0b3e0 "Resolves fdo#46074: Fix Partial::contains for paths that go past a leaf node," some registrymodification.xcu files in the wild contain such WindowType entries in "default" state, without a UserData/Data string and with a nil "Visible" property. The way SfxChildWindow::InitializeChildWinFactory_Impl and SvtViewOptions::IsVisible are implemented, they will always lead to an invisible window for such broken registrymodification.xcu data (as IsVisible unhelpfully returns false for a nil value, and InitializeChildWinFactory_Impl uses that value when there is no UserData/Data string). For the Math formula editor window (ID 30378) this means that it can disappear from the UI completely, as there appears to be no UI trigger for the user to show it in case it is hidden. The fix is to introdue SvtViewOptions::HasVisible (which only returns true if the property is not nil) and change InitializeChidlWinFactory_Impl to only use the value of IsVisible() if HasVisible() returns true. This makes the code even more baroque, but this is a rather central, generic piece of code for all sorts of windows, so I do not want to break any other uses by e.g. changing IsVisible to return true for a nil property. Change-Id: Iae40075a7116a8aabd2d25aa9334709522e23d8f diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx index 18038da..e1e24be 100644 --- a/sfx2/source/appl/childwin.cxx +++ b/sfx2/source/appl/childwin.cxx @@ -352,7 +352,7 @@ void SfxChildWindow::InitializeChildWinFactory_Impl( sal_uInt16 nId, SfxChildWin // load configuration SvtViewOptions aWinOpt( E_WINDOW, String::CreateFromInt32( nId ) ); -if ( aWinOpt.Exists() ) +if ( aWinOpt.Exists() && aWinOpt.HasVisible() ) rInfo.bVisible = aWinOpt.IsVisible(); // set state from configuration. Can be overwritten by UserData, see below ::com::sun::star::uno::Sequence < ::com::sun::star::beans::NamedValue > aSeq = aWinOpt.GetUserData(); diff --git a/unotools/inc/unotools/viewoptions.hxx b/unotools/inc/unotools/viewoptions.hxx index 2dbfdd4..8270ed9 100644 --- a/unotools/inc/unotools/viewoptions.hxx +++ b/unotools/inc/unotools/viewoptions.hxx @@ -225,6 +225,13 @@ class UNOTOOLS_DLLPUBLIC SvtViewOptions: public utl::detail::Options sal_Bool IsVisible ( ) const; void SetVisible( sal_Bool bState ); +/** Return true if the "Visible" property actually has a non-nil value + +(IsVisible will somewhat arbitrarily return false if the property is +nil.) +*/ +bool HasVisible() const; + /*-//** @short use it to set/get the extended user data (consisting of a set of named scalar values) @descr It's supported for ALL types! diff --git a/unotools/source/config/viewoptions.cxx b/unotools/source/config/viewoptions.cxx index faf5937..2b4ffbc 100644 --- a/unotools/source/config/viewoptions.cxx +++ b/unotools/source/config/viewoptions.cxx @@ -266,6 +266,8 @@ class SvtViewOptionsBase_Impl { //- public: +enum State { STATE_NONE, STATE_FALSE, STATE_TRUE }; + SvtViewOptionsBase_Impl ( const ::rtl::OUString& sList); virtual ~SvtViewOptionsBase_Impl ( ); sal_BoolExists ( const ::rtl::OUString&sName); @@ -279,7 +281,7 @@ class SvtViewOptionsBase_Impl sal_Int32 GetPageID ( const ::rtl::OUString&sName); voidSetPageID
[Libreoffice-commits] .: sfx2/source
sfx2/source/doc/doctemplates.cxx |4 sfx2/source/doc/docvor.cxx | 16 2 files changed, 8 insertions(+), 12 deletions(-) New commits: commit 02394b10d348aeabcbaceaa7659794a6b74a3768 Author: Cédric Bosdonnat Date: Wed Oct 3 15:38:54 2012 +0200 n#782597: Allow adding external templates Change-Id: I56d5a716795b7303a77194964a612c550f25eeec diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index 25ed459..281e1c7 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -678,8 +678,6 @@ sal_Bool SfxDocTplService_Impl::getTitleFromURL( const OUString& rURL, OUString& } catch ( Exception& ) { -// the document is not a StarOffice document -return sal_False; } try @@ -2014,7 +2012,6 @@ sal_Bool SfxDocTplService_Impl::addTemplate( const OUString& rGroupName, // Get the content type OUString aTitle, aType, aTargetURL2, aFullName; -// only StarOffice documents are acceptable sal_Bool bDocHasTitle = sal_False; if( !getTitleFromURL( rSourceURL, aTitle, aType, bDocHasTitle ) ) return sal_False; @@ -2573,7 +2570,6 @@ void SfxDocTplService_Impl::addFsysGroup( GroupList_Impl& rList, if ( aChildTitle.compareToAscii( "sfx.tlx" ) == 0 || aChildTitle == "groupuinames.xml" ) continue; -// only StarOffice templates are accepted sal_Bool bDocHasTitle = sal_False; if( !getTitleFromURL( aTargetURL, aChildTitle, aType, bDocHasTitle ) ) continue; diff --git a/sfx2/source/doc/docvor.cxx b/sfx2/source/doc/docvor.cxx index cf016f3..2c28cd3 100644 --- a/sfx2/source/doc/docvor.cxx +++ b/sfx2/source/doc/docvor.cxx @@ -1548,7 +1548,7 @@ String SfxOrganizeDlg_Impl::GetPath_Impl( sal_Bool bOpen, const String& rFileNam pFileDlg->SetDisplayDirectory( aObj.GetMainURL( INetURLObject::NO_DECODE ) ); } -pFileDlg->StartExecuteModal( LINK( this, SfxOrganizeDlg_Impl, ImportHdl ) ); +pFileDlg->StartExecuteModal( LINK( this, SfxOrganizeDlg_Impl, ExportHdl ) ); return aPath; } @@ -1592,18 +1592,18 @@ String SfxOrganizeDlg_Impl::GetPath_Impl( sal_Bool bOpen, const String& rFileNam // add filters of modules which are installed SvtModuleOptions aModuleOpt; if ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::E_SWRITER ) ) -sFilterExt += DEFINE_CONST_UNICODE( "*.ott;*.stw;*.oth" ); +sFilterExt += DEFINE_CONST_UNICODE( "*.ott;*.stw;*.oth;*.dot;*.dotm;*.dotx" ); if ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::E_SCALC ) ) { if ( sFilterExt.Len() > 0 ) sFilterExt += ';'; -sFilterExt += DEFINE_CONST_UNICODE( "*.ots;*.stc" ); +sFilterExt += DEFINE_CONST_UNICODE( "*.ots;*.stci;*.xlt;*.xltm;*.xltm" ); } if ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::E_SIMPRESS ) ) { if ( sFilterExt.Len() > 0 ) sFilterExt += ';'; -sFilterExt += DEFINE_CONST_UNICODE( "*.otp;*.sti" ); +sFilterExt += DEFINE_CONST_UNICODE( "*.otp;*.sti;*.pot;*.potm;*.potx" ); } if ( aModuleOpt.IsModuleInstalled( SvtModuleOptions::E_SDRAW ) ) { @@ -1644,7 +1644,7 @@ String SfxOrganizeDlg_Impl::GetPath_Impl( sal_Bool bOpen, const String& rFileNam pFileDlg->SetDisplayDirectory( aObj.GetMainURL( INetURLObject::NO_DECODE ) ); } -pFileDlg->StartExecuteModal( LINK( this, SfxOrganizeDlg_Impl, ExportHdl ) ); +pFileDlg->StartExecuteModal( LINK( this, SfxOrganizeDlg_Impl, ImportHdl ) ); return aPaths; } @@ -2225,9 +2225,9 @@ IMPL_LINK( SfxOrganizeDlg_Impl, AddFiles_Impl, Button *, pButton ) //- -IMPL_LINK_NOARG(SfxOrganizeDlg_Impl, ImportHdl) +IMPL_LINK_NOARG(SfxOrganizeDlg_Impl, ExportHdl) { -DBG_ASSERT( pFileDlg, "SfxOrganizeDlg_Impl::ImportHdl(): no file dialog" ); +DBG_ASSERT( pFileDlg, "SfxOrganizeDlg_Impl::ExportHdl(): no file dialog" ); if ( ERRCODE_NONE == pFileDlg->GetError() ) { @@ -2262,7 +2262,7 @@ IMPL_LINK_NOARG(SfxOrganizeDlg_Impl, ImportHdl) //- -IMPL_LINK_NOARG(SfxOrganizeDlg_Impl, ExportHdl) +IMPL_LINK_NOARG(SfxOrganizeDlg_Impl, ImportHdl) { DBG_ASSERT( pFileDlg, "SfxOrganizeDlg_Impl::ImportHdl(): no file dialog" ); ::com::sun::star::uno::Sequence< ::rtl::OUString > aPaths; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/doc/docfile.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 469780c715f2a5dee6c58347941aefe6f3de079f Author: Stephan Bergmann Date: Fri Sep 28 12:47:13 2012 +0200 fdo#54744: Fix broken logic of string comparison d1cc007108442056f50d3a6d1212b2b4cfdc4c14 "sal_Bool to bool, String to OUString, in SfxMedium." changed !aLogicName.CompareToAscii( "private:stream", 14 ) == COMPARE_EQUAL // (a) where that suspicious ! made it effectively behave as aLogicName.CompareToAscii( "private:stream", 14 ) != COMPARE_EQUAL // (b) to (aLogicName.compareToAscii("private:stream", 14) == 0) // (c) where (c) corresponds to (a), but the intended behavior was apparently (b): Exporting to hybrid PDF now causes the embedded ODF stream (which is saved to a private:stream URL) to be empty, as (c) is erroneously satisfied now, causing the following lines to erroneously clear SID_OUTPUTSTREAM. Change-Id: Ia2c1a69db7b4da07bfe01f52c3f6759301358a84 diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 06253f3..db5887e 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -2464,7 +2464,7 @@ void SfxMedium::Init_Impl() SFX_ITEMSET_ARG( pImp->m_pSet, pOutStreamItem, SfxUnoAnyItem, SID_OUTPUTSTREAM, false); if( pOutStreamItem && ( !( pOutStreamItem->GetValue() >>= rOutStream ) - || (pImp->m_aLogicName.compareToAscii("private:stream", 14) == 0)) ) + || (pImp->m_aLogicName.compareToAscii("private:stream", 14) != 0)) ) { pImp->m_pSet->ClearItem( SID_OUTPUTSTREAM ); OSL_FAIL( "Unexpected Output stream parameter!\n" ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source writerfilter/inc writerfilter/source writerfilter/unocomponent
sfx2/source/doc/objstor.cxx |8 +++- writerfilter/inc/dmapper/DomainMapper.hxx |3 ++- writerfilter/inc/ooxml/OOXMLDocument.hxx |1 + writerfilter/source/dmapper/DomainMapper.cxx |6 +++--- writerfilter/source/filter/ImportFilter.cxx |7 +++ writerfilter/source/filter/RtfFilter.cxx |3 ++- writerfilter/source/ooxml/OOXMLStreamImpl.cxx |9 ++--- writerfilter/source/ooxml/OOXMLStreamImpl.hxx |2 +- writerfilter/unocomponent/debugservices/ooxml/OOXMLAnalyzeService.cxx |2 +- writerfilter/unocomponent/debugservices/ooxml/OOXMLTestService.cxx|2 +- 10 files changed, 27 insertions(+), 16 deletions(-) New commits: commit ff300e59e74ee88aa6a4981b57a51af416c9e991 Author: Michael Meeks Date: Fri Sep 21 21:32:11 2012 +0100 fdo#49819 - allow slightly inconsistent docx files to be repaired diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index cf8d0c2..9e7407a 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -2219,7 +2220,12 @@ sal_Bool SfxObjectShell::ImportFrom( SfxMedium& rMedium, bool bInsert ) } return xLoader->filter( aArgs ); -}catch(...) +} +catch (const packages::zip::ZipIOException&) +{ +SetError( ERRCODE_IO_BROKENPACKAGE, "Badness in the underlying package format." ); +} +catch(...) {} } diff --git a/writerfilter/inc/dmapper/DomainMapper.hxx b/writerfilter/inc/dmapper/DomainMapper.hxx index 4dbbe87..1d9b2f0 100644 --- a/writerfilter/inc/dmapper/DomainMapper.hxx +++ b/writerfilter/inc/dmapper/DomainMapper.hxx @@ -80,7 +80,8 @@ public: DomainMapper(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext, ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > xInputStream, ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > xModel, -SourceDocumentType eDocumentType ); +bool bRepairStorage, +SourceDocumentType eDocumentType); virtual ~DomainMapper(); // Stream diff --git a/writerfilter/inc/ooxml/OOXMLDocument.hxx b/writerfilter/inc/ooxml/OOXMLDocument.hxx index f3365db..c97e2b2 100644 --- a/writerfilter/inc/ooxml/OOXMLDocument.hxx +++ b/writerfilter/inc/ooxml/OOXMLDocument.hxx @@ -248,6 +248,7 @@ public: static OOXMLStream::Pointer_t createStream(uno::Reference rContext, uno::Reference rStream, + bool bRepairStorage, OOXMLStream::StreamType_t nStreamType = OOXMLStream::DOCUMENT); static OOXMLStream::Pointer_t diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index 38a9961..cd4a17c 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -88,7 +88,8 @@ struct _PageSz DomainMapper::DomainMapper( const uno::Reference< uno::XComponentContext >& xContext, uno::Reference< io::XInputStream > xInputStream, uno::Reference< lang::XComponent > xModel, -SourceDocumentType eDocumentType) : +bool bRepairStorage, +SourceDocumentType eDocumentType ) : LoggedProperties(dmapper_logger, "DomainMapper"), LoggedTable(dmapper_logger, "DomainMapper"), LoggedStream(dmapper_logger, "DomainMapper"), @@ -101,12 +102,11 @@ LoggedStream(dmapper_logger, "DomainMapper"), uno::makeAny( false ) ); //import document properties - try { uno::Reference< lang::XMultiServiceFactory > xFactory(xContext->getServiceManager(), uno::UNO_QUERY_THROW); uno::Reference< embed::XStorage > xDocumentStorage = - (comphelper::OStorageHelper::GetStorageOfFormatFromInputStream(OFOPXML_STORAGE_FORMAT_STRING, xInputStream)); + (comphelper::OStorageHelper::GetStorageOfFormatFromInputStream(OFOPXML_STORAGE_FORMAT_STRING, xInputStream, xFactory, bRepairStorage )); uno::Reference< uno::XInterface > xTemp = xContext->getServiceManager()->createInstanceWithContext( "com.sun.star.document.OOXMLDocumentPropertiesImporter", diff --git a/writerfilter/source/filter/ImportFilter.cxx b/writerfilter/source/filter/ImportFilter.cxx index 2eef1c1..207342a 100644 --- a/writerfilter/source/filter/ImportFilter.cxx +++ b/writerfilter/source/filter/ImportFilter.cxx @@
[Libreoffice-commits] .: sfx2/source
sfx2/source/appl/appdde.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 8ed8bb24b5300267f83be9ff537599537ffa4cb0 Author: Stephan Bergmann Date: Tue Sep 18 08:21:43 2012 +0200 Adapt Windows-only code to changed ucbhelper::Content Change-Id: I1ed4a59b7eef5f841754bc616ad94cbd82227ad0 diff --git a/sfx2/source/appl/appdde.cxx b/sfx2/source/appl/appdde.cxx index 94067d9..2f28591 100644 --- a/sfx2/source/appl/appdde.cxx +++ b/sfx2/source/appl/appdde.cxx @@ -40,6 +40,7 @@ #include #include "helper.hxx" #include +#include #include #include @@ -86,7 +87,7 @@ namespace try { -::ucbhelper::Content aCnt( aObj.GetMainURL( INetURLObject::NO_DECODE ), uno::Reference< ucb::XCommandEnvironment > () ); +::ucbhelper::Content aCnt( aObj.GetMainURL( INetURLObject::NO_DECODE ), uno::Reference< ucb::XCommandEnvironment >(), comphelper::getProcessComponentContext() ); bRet = aCnt.isDocument(); } catch( const ucb::CommandAbortedException& ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/doc/objxtor.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 6c29057f55dc1afde8911ac527814ca09ead2c2f Author: Noel Power Date: Tue Sep 11 11:59:45 2012 +0100 missing part of fix for fdo#54721 commit id cea414bfe8fe356793778bdf09f5ca3b3a42daa0 for "fix vba not tracking currently selected doc correctly" was missing necessary change in sfx2 Change-Id: I1697c005374b3d26dc63c78702a46c6d9879adaa diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index a9bb168..deee41b 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -135,7 +135,7 @@ static VBAConstantNameMap s_aRegisteredVBAConstants; if( xProps.is() ) try { ::rtl::OUString aConstName; -xProps->getPropertyValue( ::rtl::OUString( "VBAGlobalConstantName" ) ) >>= aConstName; +xProps->getPropertyValue( ::rtl::OUString( "ThisVBADocObj" ) ) >>= aConstName; return ::rtl::OUStringToOString( aConstName, RTL_TEXTENCODING_ASCII_US ); } catch (const uno::Exception&) // not supported ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/control/templateview.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit 6f37f7f06b1b4810d0cee025a3502e3282c25986 Author: Rafael Dominguez Date: Tue Aug 21 13:35:20 2012 -0430 setFontAttribute on TextLayouterDevice for templateview title. Change-Id: I963994f6c20995ea9d1037cadb6c17a43e8a28c9 diff --git a/sfx2/source/control/templateview.cxx b/sfx2/source/control/templateview.cxx index bc13853..e2c7960 100644 --- a/sfx2/source/control/templateview.cxx +++ b/sfx2/source/control/templateview.cxx @@ -184,6 +184,9 @@ void TemplateView::MouseButtonDown (const MouseEvent &rMEvt) else { drawinglayer::primitive2d::TextLayouterDevice aTextDev; +aTextDev.setFontAttribute(mpItemAttrs->aFontAttr, + mpItemAttrs->aFontSize.getX(), mpItemAttrs->aFontSize.getY(), + com::sun::star::lang::Locale() ); float fTextWidth = aTextDev.getTextWidth(maName,0,maName.getLength()); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/doc/templatedlg.cxx | 27 +++ 1 file changed, 15 insertions(+), 12 deletions(-) New commits: commit f681ec232ece0ca46c2ab1b6b5e4670d553cfb3a Author: Rafael Dominguez Date: Wed Aug 15 08:23:58 2012 -0430 Disable opening a template while in save mode. Change-Id: If63cc2f6e2c46a54fd6f380f4f218c10427befe3 Reviewed-on: https://gerrit.libreoffice.org/432 Reviewed-by: Bosdonnat Cedric Tested-by: Bosdonnat Cedric diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index b6a705d..34e5713 100644 --- a/sfx2/source/doc/templatedlg.cxx +++ b/sfx2/source/doc/templatedlg.cxx @@ -659,21 +659,24 @@ IMPL_LINK(SfxTemplateManagerDlg, DefaultTemplateMenuSelectHdl, Menu*, pMenu) IMPL_LINK(SfxTemplateManagerDlg, OpenTemplateHdl, ThumbnailViewItem*, pItem) { -uno::Sequence< PropertyValue > aArgs(1); -aArgs[0].Name = "AsTemplate"; -aArgs[0].Value <<= sal_True; +if (!mbIsSaveMode) +{ +uno::Sequence< PropertyValue > aArgs(1); +aArgs[0].Name = "AsTemplate"; +aArgs[0].Value <<= sal_True; -TemplateViewItem *pTemplateItem = static_cast(pItem); +TemplateViewItem *pTemplateItem = static_cast(pItem); -try -{ - mxDesktop->loadComponentFromURL(pTemplateItem->getPath(),rtl::OUString("_default"), 0, aArgs ); -} -catch( const uno::Exception& ) -{ -} +try +{ + mxDesktop->loadComponentFromURL(pTemplateItem->getPath(),rtl::OUString("_default"), 0, aArgs ); +} +catch( const uno::Exception& ) +{ +} -Close(); +Close(); +} return 0; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/doc/objserv.cxx |5 + 1 file changed, 5 insertions(+) New commits: commit 4e923fb5a293ce570974e620b87ff84ccb6a139b Author: Stephan Bergmann Date: Thu Aug 16 17:53:45 2012 +0200 fdo#53280: Reset read-only UI after successful Save As Change-Id: Ica9214d3655df27bbb259c463a7589a842f01c47 diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index 6a25743..1bd9c9c 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -694,6 +694,11 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) nErrorCode = ( lErr != ERRCODE_IO_ABORT ) && ( nErrorCode == ERRCODE_NONE ) ? nErrorCode : lErr; } +if (nId == SID_SAVEASDOC && nErrorCode == ERRCODE_NONE) +{ +SetReadOnlyUI(false); +} + rReq.SetReturnValue( SfxBoolItem(0, nErrorCode == ERRCODE_NONE ) ); ResetError(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/doc/templatedlg.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 1df49b79fd33d0ed505c4bdd053607064b5ae88e Author: Michael Stahl Date: Wed Aug 15 14:04:04 2012 +0200 SfxTemplateManagerDlg::OnTemplateSaveAs: fix assert Change-Id: I5dac56ac36eac128f1880987c084d09d8076c3f7 diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index 9e17da4..b6a705d 100644 --- a/sfx2/source/doc/templatedlg.cxx +++ b/sfx2/source/doc/templatedlg.cxx @@ -1131,7 +1131,7 @@ void SfxTemplateManagerDlg::OnRepositoryDelete() void SfxTemplateManagerDlg::OnTemplateSaveAs() { -assert(m_xModel); +assert(m_xModel.is()); if (!maView->isOverlayVisible() && maSelFolders.empty()) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/control/templatelocalview.cxx |1 - 1 file changed, 1 deletion(-) New commits: commit 442b57834aa4e01b832cad42b2b466e8cb2a94a8 Author: Stephan Bergmann Date: Mon Jul 30 10:46:00 2012 +0200 ...or rather, renamed #include Change-Id: I01e330672d2382e9241b836e7c2b38c0a5f5f0da diff --git a/sfx2/source/control/templatelocalview.cxx b/sfx2/source/control/templatelocalview.cxx index bc1cf1b..119168d 100644 --- a/sfx2/source/control/templatelocalview.cxx +++ b/sfx2/source/control/templatelocalview.cxx @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/doc/docfile.cxx |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) New commits: commit a201c00b9330f6e765d9fe10b5a6c120f49a6da8 Author: Kohei Yoshida Date: Wed Jul 25 17:50:09 2012 -0400 The impl class is never null. No point checking for it. Change-Id: I992e335bf217f3df30356f260ef1eb0f94d40233 diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index d6a0864..21f93ab 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -2387,15 +2387,13 @@ sal_Bool SfxMedium::IsRemote() void SfxMedium::SetUpdatePickList(sal_Bool bVal) { -if(!pImp) -pImp = new SfxMedium_Impl( this ); pImp->bUpdatePickList = bVal; } //-- sal_Bool SfxMedium::IsUpdatePickList() const { -return pImp? pImp->bUpdatePickList: true; +return pImp->bUpdatePickList; } void SfxMedium::SetLongName(const OUString &rName) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/appl/shutdowniconw32.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 3e3a6a799debca97dc4f7c496eda7259dc421407 Author: Jan Holesovsky Date: Tue Jul 17 10:34:30 2012 +0200 Fix MinGW build. Change-Id: I48bad55cc982fba6fb48a921746801de9993bff1 diff --git a/sfx2/source/appl/shutdowniconw32.cxx b/sfx2/source/appl/shutdowniconw32.cxx index f4a540e..dbef7e1 100644 --- a/sfx2/source/appl/shutdowniconw32.cxx +++ b/sfx2/source/appl/shutdowniconw32.cxx @@ -280,7 +280,7 @@ static void addTaskbarIcon( HWND hWnd ) IMAGE_ICON, GetSystemMetrics( SM_CXSMICON ), GetSystemMetrics( SM_CYSMICON ), LR_DEFAULTCOLOR | LR_SHARED ); -wcsncpy( nid.szTip, strTip.getStr(), 64 ); +wcsncpy( nid.szTip, reinterpret_cast(strTip.getStr()), 64 ); nid.cbSize = sizeof(nid); nid.hWnd= hWnd; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/appl/shutdowniconw32.cxx |7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) New commits: commit 34ebc821d9942641c256157ada9f817338832711 Author: Andras Timar Date: Mon Jul 16 15:03:46 2012 +0200 fdo#52143 use Unicode functions for QuickStarter tooltip Change-Id: Ic9c7ed84925ea5b4ce324a98a1089102dcda24b8 diff --git a/sfx2/source/appl/shutdowniconw32.cxx b/sfx2/source/appl/shutdowniconw32.cxx index 78d1a9c..f4a540e 100644 --- a/sfx2/source/appl/shutdowniconw32.cxx +++ b/sfx2/source/appl/shutdowniconw32.cxx @@ -275,13 +275,12 @@ static void addTaskbarIcon( HWND hWnd ) strTip = ShutdownIcon::getInstance()->GetResString( STR_QUICKSTART_TIP ); // add taskbar icon -NOTIFYICONDATAA nid; +NOTIFYICONDATAW nid; nid.hIcon = (HICON)LoadImageA( GetModuleHandle( NULL ), MAKEINTRESOURCE( ICON_LO_DEFAULT ), IMAGE_ICON, GetSystemMetrics( SM_CXSMICON ), GetSystemMetrics( SM_CYSMICON ), LR_DEFAULTCOLOR | LR_SHARED ); -// better use unicode wrapper here ? -strncpy( nid.szTip, ( OUStringToOString(strTip, osl_getThreadTextEncoding()).getStr() ), 64 ); +wcsncpy( nid.szTip, strTip.getStr(), 64 ); nid.cbSize = sizeof(nid); nid.hWnd= hWnd; @@ -289,7 +288,7 @@ static void addTaskbarIcon( HWND hWnd ) nid.uCallbackMessage= SFX_TASKBAR_NOTIFICATION; nid.uFlags = NIF_MESSAGE|NIF_TIP|NIF_ICON; -Shell_NotifyIconA(NIM_ADD, &nid); +Shell_NotifyIconW(NIM_ADD, &nid); } // --- ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/dialog/filtergrouping.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit c64e33efb0f26c9bc9298c7e902efe9af22ca500 Author: Julien Nabet Date: Sun Jul 15 15:26:06 2012 +0200 Possible inefficient checking for emptiness Change-Id: I049ebd41756ffdd73f534c3bf34f81106f8549a9 diff --git a/sfx2/source/dialog/filtergrouping.cxx b/sfx2/source/dialog/filtergrouping.cxx index 2745d65..ce73733 100644 --- a/sfx2/source/dialog/filtergrouping.cxx +++ b/sfx2/source/dialog/filtergrouping.cxx @@ -1048,7 +1048,7 @@ namespace sfx2 if ( xFilterGroupManager.is() ) { // Add both html/pdf filter as a filter group to get a separator between both groups -if ( aImportantFilterGroup.size() > 0 ) +if ( !aImportantFilterGroup.empty() ) { Sequence< StringPair > aFilters( aImportantFilterGroup.size() ); for ( sal_Int32 i = 0; i < (sal_Int32)aImportantFilterGroup.size(); i++ ) @@ -1068,7 +1068,7 @@ namespace sfx2 } } -if ( aFilterGroup.size() > 0 ) +if ( !aFilterGroup.empty() ) { Sequence< StringPair > aFilters( aFilterGroup.size() ); for ( sal_Int32 i = 0; i < (sal_Int32)aFilterGroup.size(); i++ ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/appl/lnkbase2.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 602445c1aae34c1770b627c60238f4f8ba8515ac Author: Julien Nabet Date: Sun Jul 15 15:24:09 2012 +0200 Prefer prefix ++/-- operators for non-primitive types Change-Id: I6cfaf9f4623c67fcf9383426f04b32e095acbf42 diff --git a/sfx2/source/appl/lnkbase2.cxx b/sfx2/source/appl/lnkbase2.cxx index d22c4fd..8bc6704 100644 --- a/sfx2/source/appl/lnkbase2.cxx +++ b/sfx2/source/appl/lnkbase2.cxx @@ -620,7 +620,7 @@ static DdeTopic* FindTopic( const String & rLinkName, sal_uInt16* pItemStt ) for( int i = 0; i < 2; ++i ) { for( std::vector::iterator iterTopic = rTopics.begin(); - iterTopic != rTopics.end(); iterTopic++ ) + iterTopic != rTopics.end(); ++iterTopic ) if( (*iterTopic)->GetName() == sTopic ) return *iterTopic; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/appl/app.src |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 0d2afe08450ad041afa21adf48d6c6d90e8cc4e0 Author: Laurent Godard Date: Wed Jul 11 17:07:23 2012 +0200 change Exit menu entry to Exit %PRODUCTNAME fdo#51944 Some user do not understand that Exit is for exiting all libreoffice modules and not exiting the current window Change-Id: If3a88a1e7f79c5c19f3011ba65dde3cda11462a4 diff --git a/sfx2/source/appl/app.src b/sfx2/source/appl/app.src index de7368a..bcb19cb 100644 --- a/sfx2/source/appl/app.src +++ b/sfx2/source/appl/app.src @@ -257,7 +257,7 @@ ToolBox RID_FULLSCREENTOOLBOX String STR_QUITAPP { -Text [ en-US ] = "E~xit" ; +Text [ en-US ] = "E~xit %PRODUCTNAME" ; }; String RID_STR_HELP ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/doc/templatedlg.src |8 1 file changed, 8 deletions(-) New commits: commit 0a158923ac74714cecb47a977d553746a730bf7b Author: Rafael Dominguez Date: Fri Jul 6 13:41:36 2012 -0430 Remove unused image resource. Change-Id: I789006f413b750d67e80fcedec9130f33275d74f diff --git a/sfx2/source/doc/templatedlg.src b/sfx2/source/doc/templatedlg.src index 08275ba..0a8f851 100644 --- a/sfx2/source/doc/templatedlg.src +++ b/sfx2/source/doc/templatedlg.src @@ -130,14 +130,6 @@ ModalDialog DLG_TEMPLATE_MANAGER TabStop = TRUE; }; -Image IMG_ONLINE_REPOSITORY -{ -ImageBitmap = Bitmap -{ -File = "signet.png"; -}; -}; - Image IMG_CREATE_TEXT { ImageBitmap = Bitmap ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/doc/templatedlg.src |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 94d16ebac784e6d04e1274c728b880c7d79d1575 Author: Michael Meeks Date: Fri Jul 6 18:03:25 2012 +0100 revert change to missing image; please change back when it's added. Change-Id: Icde577676e5ae55786dd2341291aad788bc40abc diff --git a/sfx2/source/doc/templatedlg.src b/sfx2/source/doc/templatedlg.src index f0ac332..08275ba 100644 --- a/sfx2/source/doc/templatedlg.src +++ b/sfx2/source/doc/templatedlg.src @@ -134,7 +134,7 @@ ModalDialog DLG_TEMPLATE_MANAGER { ImageBitmap = Bitmap { -File = "ln053.png"; +File = "signet.png"; }; }; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/appl/appdde.cxx |5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) New commits: commit f859ee7f9b867ab893d2414c2cd35b42b64a5e63 Author: Michael Stahl Date: Sat Jun 9 00:58:14 2012 +0200 sigh... fix const abuse in WNT only code... Change-Id: Ie6a93e15f4e7342faf232f28df133ff808cbe073 diff --git a/sfx2/source/appl/appdde.cxx b/sfx2/source/appl/appdde.cxx index 10d5b19..f72e64a 100644 --- a/sfx2/source/appl/appdde.cxx +++ b/sfx2/source/appl/appdde.cxx @@ -593,7 +593,7 @@ void SfxApplication::AddDdeTopic( SfxObjectShell* pSh ) } } -const SfxDdeDocTopic_Impl* pTopic = new SfxDdeDocTopic_Impl( pSh ); +SfxDdeDocTopic_Impl *const pTopic = new SfxDdeDocTopic_Impl(pSh); pAppData_Impl->pDocTopics->push_back(pTopic); pAppData_Impl->pDdeService->AddTopic( *pTopic ); } @@ -606,10 +606,9 @@ void SfxApplication::RemoveDdeTopic( SfxObjectShell* pSh ) if( !pAppData_Impl->pDocTopics ) return; -SfxDdeDocTopic_Impl* pTopic; for (size_t n = pAppData_Impl->pDocTopics->size(); n; ) { -pTopic = (*pAppData_Impl->pDocTopics)[ --n ]; +SfxDdeDocTopic_Impl *const pTopic = (*pAppData_Impl->pDocTopics)[ --n ]; if (pTopic->pSh == pSh) { pAppData_Impl->pDdeService->RemoveTopic( *pTopic ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/appl/appdde.cxx | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) New commits: commit f4ac2ffd9e0854a767f15ed38eab947cb16e66ad Author: Michael Stahl Date: Sat Jun 9 00:31:29 2012 +0200 fix WNT only SfxApplication::AddDdeTopic Change-Id: Ifa5f845817178f7ec3608670c65c71e8c0a717cd diff --git a/sfx2/source/appl/appdde.cxx b/sfx2/source/appl/appdde.cxx index e6d3706..10d5b19 100644 --- a/sfx2/source/appl/appdde.cxx +++ b/sfx2/source/appl/appdde.cxx @@ -577,7 +577,8 @@ void SfxApplication::AddDdeTopic( SfxObjectShell* pSh ) // prevent double submit String sShellNm; sal_Bool bFnd = sal_False; -for( sal_uInt16 n = pAppData_Impl->pDocTopics->Count(); n; ) +for (size_t n = pAppData_Impl->pDocTopics->size(); n;) +{ if( (*pAppData_Impl->pDocTopics)[ --n ]->pSh == pSh ) { // If the document is untitled, is still a new Topic is created! @@ -590,10 +591,10 @@ void SfxApplication::AddDdeTopic( SfxObjectShell* pSh ) if( sShellNm == sNm.ToLowerAscii() ) return ; } +} const SfxDdeDocTopic_Impl* pTopic = new SfxDdeDocTopic_Impl( pSh ); -pAppData_Impl->pDocTopics->Insert( pTopic, - pAppData_Impl->pDocTopics->Count() ); +pAppData_Impl->pDocTopics->push_back(pTopic); pAppData_Impl->pDdeService->AddTopic( *pTopic ); } #endif @@ -606,13 +607,16 @@ void SfxApplication::RemoveDdeTopic( SfxObjectShell* pSh ) return; SfxDdeDocTopic_Impl* pTopic; -for( sal_uInt16 n = pAppData_Impl->pDocTopics->size(); n; ) -if( ( pTopic = (*pAppData_Impl->pDocTopics)[ --n ])->pSh == pSh ) +for (size_t n = pAppData_Impl->pDocTopics->size(); n; ) +{ +pTopic = (*pAppData_Impl->pDocTopics)[ --n ]; +if (pTopic->pSh == pSh) { pAppData_Impl->pDdeService->RemoveTopic( *pTopic ); delete pTopic; pAppData_Impl->pDocTopics->erase( pAppData_Impl->pDocTopics->begin() + n ); } +} } const DdeService* SfxApplication::GetDdeService() const ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/bastyp/fltfnc.cxx | 37 +++-- 1 file changed, 27 insertions(+), 10 deletions(-) New commits: commit 3da8f3680556e0163f660a0a159930337c8c32ff Author: Kohei Yoshida Date: Tue Jun 5 15:45:52 2012 -0400 fdo#50694: Honor the preferred filter returned by type detection. Because that filter is more reliable. Change-Id: Ifbab294bf4f344301410cd671a9245bffa03fa11 diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx index fbb253e..72b3590 100644 --- a/sfx2/source/bastyp/fltfnc.cxx +++ b/sfx2/source/bastyp/fltfnc.cxx @@ -433,6 +433,7 @@ sal_uInt32 SfxFilterMatcher::GuessFilterControlDefaultUI( SfxMedium& rMedium, c ::rtl::OUString sURL( rMedium.GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) ); ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > xInStream = rMedium.GetInputStream(); +rtl::OUString aFilterName; // stream exists => deep detection (with preselection ... if possible) if (xInStream.is()) @@ -454,6 +455,13 @@ sal_uInt32 SfxFilterMatcher::GuessFilterControlDefaultUI( SfxMedium& rMedium, c ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > lDescriptor = aDescriptor.getAsConstPropertyValueList(); sTypeName = xDetection->queryTypeByDescriptor(lDescriptor, sal_True); // lDescriptor is used as In/Out param ... dont use aDescriptor.getAsConstPropertyValueList() directly! + +for (sal_Int32 i = 0; i < lDescriptor.getLength(); ++i) +{ +if (lDescriptor[i].Name == "FilterName") +// Type detection picked a preferred filter for this format. +aFilterName = lDescriptor[i].Value.get(); +} } // no stream exists => try flat detection without preselection as fallback else @@ -461,16 +469,25 @@ sal_uInt32 SfxFilterMatcher::GuessFilterControlDefaultUI( SfxMedium& rMedium, c if (!sTypeName.isEmpty()) { -// detect filter by given type -// In case of this matcher is bound to a particular document type: -// If there is no acceptable type for this document at all, the type detection has possibly returned something else. -// The DocumentService property is only a preselection, and all preselections are considered as optional! -// This "wrong" type will be sorted out now because we match only allowed filters to the detected type -::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > lQuery(1); -lQuery[0].Name = ::rtl::OUString("Name"); -lQuery[0].Value <<= sTypeName; - -const SfxFilter* pFilter = GetFilterForProps(lQuery, nMust, nDont); +const SfxFilter* pFilter = NULL; +if (!aFilterName.isEmpty()) +// Type detection returned a suitable filter for this. Use it. +pFilter = SfxFilter::GetFilterByName(aFilterName); + +if (!pFilter) +{ +// detect filter by given type +// In case of this matcher is bound to a particular document type: +// If there is no acceptable type for this document at all, the type detection has possibly returned something else. +// The DocumentService property is only a preselection, and all preselections are considered as optional! +// This "wrong" type will be sorted out now because we match only allowed filters to the detected type +::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue > lQuery(1); +lQuery[0].Name = ::rtl::OUString("Name"); +lQuery[0].Value <<= sTypeName; + +pFilter = GetFilterForProps(lQuery, nMust, nDont); +} + if (pFilter) { *ppFilter = pFilter; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/control/unoctitm.cxx | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) New commits: commit f6d9b4afbda6cf1a3db822b5fb5125448ef9e1d1 Author: Kohei Yoshida Date: Thu May 24 11:40:46 2012 -0400 Delete SfxItemSet before the current shell gets destroyed. SfxItemSet takes hold of the SfxItemPool instance from the current shell, and accesses it when it gets destroyed. The problem arises when the current shell gets destroyed before the SfxItemSet instnace does, in which case an illegal memory access ensues. This fixes intermittent crashes when opening a document in Writer. Change-Id: Ib5e74b43051f868f22f6efdb311e6c2a75326d9a diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index 005db6e..360590f 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -67,6 +67,8 @@ #include #include +#include + namespace css = ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::util; @@ -725,16 +727,20 @@ void SAL_CALL SfxDispatchController_Impl::dispatch( const ::com::sun::star::util } eMapUnit = GetCoreMetric( pShell->GetPool(), GetId() ); -SfxAllItemSet aSet( pShell->GetPool() ); -TransformParameters( GetId(), lNewArgs, aSet, pSlot ); -if ( aSet.Count() ) +boost::scoped_ptr xSet(new SfxAllItemSet(pShell->GetPool())); +TransformParameters(GetId(), lNewArgs, *xSet, pSlot); +if (xSet->Count()) { // execute with arguments - call directly -pItem = pDispatcher->Execute( GetId(), nCall, &aSet, &aInternalSet, nModifier ); +pItem = pDispatcher->Execute(GetId(), nCall, xSet.get(), &aInternalSet, nModifier); bSuccess = (pItem != NULL); } else { +// Be sure to delete this before we send a dispatch +// request, which will destroy the current shell. +xSet.reset(); + // execute using bindings, enables support for toggle/enum etc. SfxRequest aReq( GetId(), nCall, pShell->GetPool() ); aReq.SetModifier( nModifier ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/dialog/filedlghelper.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit ce44a0326e9e399a23d0adaadcf99f2e62a363d7 Author: Stephan Bergmann Date: Fri Apr 27 17:22:43 2012 +0200 Missing #include Change-Id: I79490015faf57a3f84395fa9ba29dd17503b9ef6 diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 43f643e..0fcc340 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -102,7 +102,9 @@ #include #include #include + #ifdef UNX +#include #include #endif ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/dialog/filedlghelper.cxx | 61 ++- 1 file changed, 47 insertions(+), 14 deletions(-) New commits: commit 2d0ff6aa5d6951aaa00e2d6cf3878788b025983e Author: Stephan Bergmann Date: Fri Apr 27 16:54:32 2012 +0200 Related fdo#43895: Fixed shortcommings of FileDialogHelper_Impl::verifyPath * maPath.reverseCompareToAsciiL("file:///tmp",11) == 0 failed for file:///tmp/ * It was unclear whether special treatment should only happen for files directly in /tmp or also in sub-dirs; assuming the latter now. * Proper translation from file URL to system path. diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 138f8a3..43f643e 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -63,6 +63,7 @@ #include #include #include +#include #include #include #include @@ -1641,24 +1642,56 @@ void FileDialogHelper_Impl::getRealFilter( String& _rFilter ) const void FileDialogHelper_Impl::verifyPath() { #ifdef UNX -static char const s_FileScheme[] = "file://"; -if (0 != rtl_ustr_ascii_shortenedCompareIgnoreAsciiCase_WithLength( -maPath.getStr(), maPath.getLength(), -s_FileScheme, RTL_CONSTASCII_LENGTH(s_FileScheme))) -{ -return; -} -const OString sFullPath = OUStringToOString( -maPath.copy(RTL_CONSTASCII_LENGTH(s_FileScheme)) + maFileName, -osl_getThreadTextEncoding() ); -struct stat aFileStat; -stat( sFullPath.getStr(), &aFileStat ); // lp#905355, fdo#43895 // Check that the file has read only permission and is in /tmp -- this is // the case if we have opened the file from the web with firefox only. -if ( maPath.reverseCompareToAsciiL("file:///tmp",11) == 0 && -( aFileStat.st_mode & (S_IRWXO + S_IRWXG + S_IRWXU) ) == S_IRUSR ) +if (maFileName.isEmpty()) { +return; +} +INetURLObject url(maPath); +if (url.GetProtocol() != INET_PROT_FILE +|| url.getName(0, true, INetURLObject::DECODE_WITH_CHARSET) != "tmp") +{ +return; +} +if (maFileName.indexOf('/') != -1) { +SAL_WARN("sfx2", maFileName << " contains /"); +return; +} +url.insertName( +maFileName, false, INetURLObject::LAST_SEGMENT, true, +INetURLObject::ENCODE_ALL); +rtl::OUString sysPathU; +osl::FileBase::RC e = osl::FileBase::getSystemPathFromFileURL( +url.GetMainURL(INetURLObject::NO_DECODE), sysPathU); +if (e != osl::FileBase::E_None) { +SAL_WARN( +"sfx2", +"getSystemPathFromFileURL(" +<< url.GetMainURL(INetURLObject::NO_DECODE) << ") failed with " +<< +e); +return; +} +rtl::OString sysPathC; +if (!sysPathU.convertToString( +&sysPathC, osl_getThreadTextEncoding(), +(RTL_UNICODETOTEXT_FLAGS_UNDEFINED_ERROR + | RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR))) { +SAL_WARN( +"sfx2", +"convertToString(" << sysPathU << ") failed for encoding " +<< +osl_getThreadTextEncoding()); +return; +} +struct stat aFileStat; +if (stat(sysPathC.getStr(), &aFileStat) == -1) { +SAL_WARN( +"sfx2", +"stat(" << sysPathC.getStr() << ") failed with errno " << errno); +return; +} +if ((aFileStat.st_mode & (S_IRWXO | S_IRWXG | S_IRWXU)) == S_IRUSR) { maPath = SvtPathOptions().GetWorkPath(); mxFileDlg->setDisplayDirectory( maPath ); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: sfx2/source
sfx2/source/appl/sfxpicklist.cxx |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) New commits: commit de4c18bacaf75f378da829c2114a67f4007d7a22 Author: Stephan Bergmann Date: Fri Apr 27 11:08:37 2012 +0200 Related fdo#37775: Update Recent Documents for r/o docs, too ...not sure why this explicit check was there at all. Before the fix for fdo#37775, the check was not an issue, as docs were only added to Recent Documents upon saving them, anyway. diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx index 1198732..b3c48f2 100644 --- a/sfx2/source/appl/sfxpicklist.cxx +++ b/sfx2/source/appl/sfxpicklist.cxx @@ -180,8 +180,7 @@ void SfxPickList::AddDocumentToPickList( SfxObjectShell* pDocSh ) if ( aURL.GetProtocol() == INET_PROT_VND_SUN_STAR_HELP ) return; -// only add r/w document into picklist -if ( pDocSh->IsReadOnly() || !pMed->IsUpdatePickList() ) +if ( !pMed->IsUpdatePickList() ) return; // add no document that forbids this (for example Message-Body) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits