[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sfx2/source

2013-10-10 Thread Eike Rathke
 sfx2/source/appl/fileobj.cxx |   31 +--
 1 file changed, 25 insertions(+), 6 deletions(-)

New commits:
commit 4c8e5c2a5cf67661ebf33be5c5c2700a4c389f7c
Author: Eike Rathke er...@redhat.com
Date:   Fri Oct 11 01:08:01 2013 +0200

resolved fdo#69948 honor a detected FilterName

TypeDetection::queryTypeByDescriptor() adds the FilterName property to
the MediaDescriptor, use that if present.

Strangely enough the sequence returned by XNameAccess::getByName(sType)
of the type detection contains an empty PreferredFilter value so that is
useless in this scenario.

(cherry picked from commit 823278dd095d754d0f673ef140c36c9fa7ebeffd)

Conflicts:
sfx2/source/appl/fileobj.cxx

Backported.

Change-Id: I5cdc9fe71e35bdb7c511739c7f7728134941649a
Reviewed-on: https://gerrit.libreoffice.org/6208
Reviewed-by: Kohei Yoshida libreoff...@kohei.us
Tested-by: Kohei Yoshida libreoff...@kohei.us

diff --git a/sfx2/source/appl/fileobj.cxx b/sfx2/source/appl/fileobj.cxx
index 385b8b0..abda2a5 100644
--- a/sfx2/source/appl/fileobj.cxx
+++ b/sfx2/source/appl/fileobj.cxx
@@ -397,13 +397,32 @@ String impl_getFilter( const String _rURL )
 ::rtl::OUString sType = xTypeDetection-queryTypeByDescriptor( 
aDescrList, sal_True );
 if ( !sType.isEmpty() )
 {
-css::uno::Reference css::container::XNameAccess  xTypeCont( 
xTypeDetection,
-  
css::uno::UNO_QUERY );
-if ( xTypeCont.is() )
+// Honor a selected/detected filter.
+for (sal_Int32 i=0; i  aDescrList.getLength(); ++i)
 {
-::comphelper::SequenceAsHashMap lTypeProps( 
xTypeCont-getByName( sType ) );
-sFilter = lTypeProps.getUnpackedValueOrDefault(
-::rtl::OUString(PreferredFilter), ::rtl::OUString() 
);
+if (aDescrList[i].Name == FilterName)
+{
+OUString aFilterName;
+if (aDescrList[i].Value = aFilterName)
+{
+sFilter = aFilterName;
+break;
+}
+}
+}
+if (!sFilter.Len())
+{
+css::uno::Reference css::container::XNameAccess  
xTypeCont( xTypeDetection,
+css::uno::UNO_QUERY );
+if ( xTypeCont.is() )
+{
+/* XXX: for fdo#69948 scenario the sequence returned by
+ * getByName() contains an empty PreferredFilter
+ * property value (since? expected?) */
+::comphelper::SequenceAsHashMap lTypeProps( 
xTypeCont-getByName( sType ) );
+sFilter = lTypeProps.getUnpackedValueOrDefault(
+::rtl::OUString(PreferredFilter), 
::rtl::OUString() );
+}
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sfx2/source

2013-07-31 Thread Noel Power
 sfx2/source/doc/templatedlg.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit d125339986db266025faa344f87a89bb34a9901b
Author: Noel Power noel.po...@suse.com
Date:   Wed Jul 31 15:52:05 2013 +0100

fix for fdo#60883 ( macros disabled for documents opened from templates )

Change-Id: I5d4478176bd18a5d7a08dd4472393ea56e1ea280
(cherry picked from commit 4bc42b6d7140144f5e17528276e8ddc80c033d6d)
Reviewed-on: https://gerrit.libreoffice.org/5220
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 82289ba..e6d16dd 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -52,6 +52,7 @@
 #include com/sun/star/ui/dialogs/ExecutableDialogResults.hpp
 #include com/sun/star/ui/dialogs/TemplateDescription.hpp
 #include com/sun/star/ui/dialogs/FolderPicker.hpp
+#include com/sun/star/task/InteractionHandler.hpp
 
 #include doc.hrc
 #include templatedlg.hrc
@@ -740,13 +741,15 @@ IMPL_LINK(SfxTemplateManagerDlg, OpenTemplateHdl, 
ThumbnailViewItem*, pItem)
 {
 if (!mbIsSaveMode)
 {
-uno::Sequence PropertyValue  aArgs(3);
+uno::Sequence PropertyValue  aArgs(4);
 aArgs[0].Name = AsTemplate;
 aArgs[0].Value = sal_True;
 aArgs[1].Name = MacroExecutionMode;
 aArgs[1].Value = MacroExecMode::USE_CONFIG;
 aArgs[2].Name = UpdateDocMode;
 aArgs[2].Value = UpdateDocMode::ACCORDING_TO_CONFIG;
+aArgs[3].Name = InteractionHandler;
+aArgs[3].Value = task::InteractionHandler::createWithParent( 
::comphelper::getProcessComponentContext(), 0 );
 
 TemplateViewItem *pTemplateItem = 
static_castTemplateViewItem*(pItem);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sfx2/source

2013-07-08 Thread Michael Stahl
 sfx2/source/doc/guisaveas.cxx|5 +++--
 sfx2/source/doc/sfxbasemodel.cxx |4 +++-
 2 files changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 170edbcf85fd77ab9b3470bf7a727dadb377a416
Author: Michael Stahl mst...@redhat.com
Date:   Mon Jul 8 18:26:47 2013 +0200

fdo#65055: sfx: fix automatic version on close

The parameter FailOnWarning is passed around better now, so it arrives
in SfxBaseModel::storeSelf() which considers it illegal.

(regression from e2799d253b1dc62967693aa5bccd7360a9520967)

Change-Id: I2a51a2ecc24e6de506e1840bd28cbe157a8ad6a5
(cherry picked from commit 969bc572441ef8fd43cd7d350a533ffd715b74d3)
Reviewed-on: https://gerrit.libreoffice.org/4774
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index c6af316..9c30418 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -1374,9 +1374,10 @@ sal_Bool SfxStoringHelper::GUIStoreModel( const 
uno::Reference frame::XModel 
 {
 aModelData.GetStorable2()-storeSelf( 
aModelData.GetMediaDescr().getAsConstPropertyValueList() );
 }
-catch( const lang::IllegalArgumentException )
+catch (const lang::IllegalArgumentException e)
 {
-OSL_FAIL( ModelData didn't handle illegal parameters, all the 
parameters are ignored!\n );
+SAL_WARN(sfx, Ignoring parameters! 
+ModelData considers this illegal:e.Message);
 aModelData.GetStorable()-store();
 }
 }
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 540c190..def9202 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -1568,7 +1568,9 @@ void SAL_CALL SfxBaseModel::storeSelf( const
uno::Sequence beans::PropertyVa
 // check that only acceptable parameters are provided here
 if ( aSeqArgs[nInd].Name != VersionComment  
aSeqArgs[nInd].Name != Author
aSeqArgs[nInd].Name != InteractionHandler  
aSeqArgs[nInd].Name != StatusIndicator
-   aSeqArgs[nInd].Name != VersionMajor  aSeqArgs[nInd].Name 
!= CheckIn )
+   aSeqArgs[nInd].Name != VersionMajor
+   aSeqArgs[nInd].Name != FailOnWarning
+   aSeqArgs[nInd].Name != CheckIn )
 {
 m_pData-m_pObjectShell-AddLog( ::rtl::OUString( 
OSL_LOG_PREFIX unexpected parameter for storeSelf, might be no problem if 
SaveAs is executed.  ) );
 m_pData-m_pObjectShell-StoreLog();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sfx2/source

2013-07-03 Thread Michael Stahl
 sfx2/source/dialog/templdlg.cxx |   44 ++--
 sfx2/source/inc/templdgi.hxx|1 
 2 files changed, 26 insertions(+), 19 deletions(-)

New commits:
commit 8c51ceb7166e63950cd7284fd59e8971c43605ee
Author: Michael Stahl mst...@redhat.com
Date:   Tue Jul 2 20:46:33 2013 +0200

fdo#61429: Stylist: try a little harder to restore hierarchical

Change-Id: I30972224c5a9aa12c4ef4c2b5ca80e7aece0baad
(cherry picked from commit 8f04b172c5c78fa80c3692a729f0191425195869)
Reviewed-on: https://gerrit.libreoffice.org/4687
Reviewed-by: Bosdonnat Cedric cedric.bosdon...@free.fr
Tested-by: Bosdonnat Cedric cedric.bosdon...@free.fr

diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index c551bac..4ef3cdf 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -958,14 +958,17 @@ void SfxCommonTemplateDialog_Impl::Initialize()
 ReadResource();
 pBindings-Invalidate( SID_STYLE_FAMILY );
 pBindings-Update( SID_STYLE_FAMILY );
+
 Update_Impl();
 
 aFilterLb.SetSelectHdl( LINK( this, SfxCommonTemplateDialog_Impl, 
FilterSelectHdl ) );
 aFmtLb.SetDoubleClickHdl( LINK( this, SfxCommonTemplateDialog_Impl, 
ApplyHdl ) );
 aFmtLb.SetSelectHdl( LINK( this, SfxCommonTemplateDialog_Impl, 
FmtSelectHdl ) );
 
+
 aFilterLb.Show();
-aFmtLb.Show();
+if (!bHierarchical)
+aFmtLb.Show();
 }
 
 //-
@@ -1282,6 +1285,7 @@ void 
SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(sal_uInt16 nFlags)
 if (pTreeBox || m_bWantHierarchical)
 {
 
aFilterLb.SelectEntry(SfxResId(STR_STYLE_FILTER_HIERARCHICAL).toString());
+EnableHierarchical(true);
 }
 
 // show maximum 14 entries
@@ -1290,21 +1294,12 @@ void 
SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(sal_uInt16 nFlags)
 }
 else
 {
-if (m_bWantHierarchical)
-{
-nActFilter = 0;
-aFilterLb.SelectEntry(SfxResId(
-STR_STYLE_FILTER_HIERARCHICAL).toString());
-}
+if (nActFilter  aFilterLb.GetEntryCount() - 1)
+aFilterLb.SelectEntryPos(nActFilter + 1);
 else
 {
-if (nActFilter  aFilterLb.GetEntryCount() - 1)
-aFilterLb.SelectEntryPos(nActFilter + 1);
-else
-{
-nActFilter = 0;
-aFilterLb.SelectEntryPos(1);
-}
+nActFilter = 0;
+aFilterLb.SelectEntryPos(1);
 }
 }
 
@@ -1740,11 +1735,11 @@ sal_Bool SfxCommonTemplateDialog_Impl::Execute_Impl(
 //-
 
 // Handler der Listbox der Filter
-IMPL_LINK( SfxCommonTemplateDialog_Impl, FilterSelectHdl, ListBox *, pBox )
+void SfxCommonTemplateDialog_Impl::EnableHierarchical(bool const bEnable)
 {
-if ( 
SfxResId(STR_STYLE_FILTER_HIERARCHICAL).toString().equals(pBox-GetSelectEntry())
 )
+if (bEnable)
 {
-if ( !bHierarchical )
+if (!bHierarchical)
 {
 // Turn on treeView
 bHierarchical=sal_True;
@@ -1775,7 +1770,6 @@ IMPL_LINK( SfxCommonTemplateDialog_Impl, FilterSelectHdl, 
ListBox *, pBox )
 pTreeBox-Show();
 }
 }
-
 else
 {
 DELETEZ(pTreeBox);
@@ -1783,9 +1777,21 @@ IMPL_LINK( SfxCommonTemplateDialog_Impl, 
FilterSelectHdl, ListBox *, pBox )
 // If bHierarchical, then the family can have changed
 // minus one since hierarchical is inserted at the start
 m_bWantHierarchical = sal_False; // before FilterSelect
-FilterSelect(pBox-GetSelectEntryPos() - 1, bHierarchical );
+FilterSelect(aFilterLb.GetSelectEntryPos() - 1, bHierarchical );
 bHierarchical=sal_False;
 }
+}
+
+IMPL_LINK( SfxCommonTemplateDialog_Impl, FilterSelectHdl, ListBox *, pBox )
+{
+if 
(SfxResId(STR_STYLE_FILTER_HIERARCHICAL).toString().equals(pBox-GetSelectEntry()))
+{
+EnableHierarchical(true);
+}
+else
+{
+EnableHierarchical(false);
+}
 
 return 0;
 }
diff --git a/sfx2/source/inc/templdgi.hxx b/sfx2/source/inc/templdgi.hxx
index c78ad47..ebefb76 100644
--- a/sfx2/source/inc/templdgi.hxx
+++ b/sfx2/source/inc/templdgi.hxx
@@ -202,6 +202,7 @@ protected:
 voidResetFocus();
 voidEnableDelete();
 voidInitialize();
+voidEnableHierarchical(bool);
 
 voidFilterSelect( sal_uInt16 nFilterIdx, sal_Bool bForce = 
sal_False );
 voidSetFamilyState( sal_uInt16 nSlotId, const 
SfxTemplateItem* );
___

[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sfx2/source

2013-06-22 Thread Caolán McNamara
 sfx2/source/doc/docfile.cxx |   29 ++---
 1 file changed, 26 insertions(+), 3 deletions(-)

New commits:
commit e54b0c7c36e7368d7b4fffd0ddd3f3c57349a938
Author: Caolán McNamara caol...@redhat.com
Date:   Fri Jun 21 16:05:04 2013 +0100

Resolves: fdo#65501 ensure configured backup dir exists before using it

the ucb stuff is the most god awful painful api ever

Change-Id: I491d2cb9b7d5d37723b32f0a26a22a09c16bc02e
(cherry picked from commit ecdd9d1a47587aa7557c1b151010c78efa90fef2)
Reviewed-on: https://gerrit.libreoffice.org/4434
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index d08f3fc..70cee75 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -2113,6 +2113,25 @@ void SfxMedium::DoInternalBackup_Impl( const 
::ucbhelper::Content aOriginalCont
 aTransactTemp.EnableKillingFile( true );
 }
 
+bool ensureFolder(
+uno::Reference uno::XComponentContext  xCtx,
+uno::Reference ucb::XCommandEnvironment  xEnv,
+const OUString rFolder, ucbhelper::Content  result)
+{
+INetURLObject aURL( rFolder );
+OUString aTitle = aURL.getName( INetURLObject::LAST_SEGMENT, true, 
INetURLObject::DECODE_WITH_CHARSET );
+aURL.removeSegment();
+::ucbhelper::Content aParent;
+
+if ( ::ucbhelper::Content::create( aURL.GetMainURL( 
INetURLObject::NO_DECODE ),
+  xEnv, xCtx, aParent ) )
+{
+return ::utl::UCBContentHelper::MakeFolder(aParent, aTitle, result);
+}
+
+return false;
+}
+
 //--
 void SfxMedium::DoInternalBackup_Impl( const ::ucbhelper::Content 
aOriginalContent )
 {
@@ -2126,9 +2145,13 @@ void SfxMedium::DoInternalBackup_Impl( const 
::ucbhelper::Content aOriginalCont
 sal_Int32 nPrefixLen = aFileName.lastIndexOf( '.' );
 String aPrefix = ( nPrefixLen == -1 ) ? aFileName : aFileName.copy( 0, 
nPrefixLen );
 String aExtension = ( nPrefixLen == -1 ) ? String() : 
String(aFileName.copy( nPrefixLen ));
-   String aBakDir = SvtPathOptions().GetBackupPath();
+String aBakDir = SvtPathOptions().GetBackupPath();
 
-DoInternalBackup_Impl( aOriginalContent, aPrefix, aExtension, aBakDir );
+// create content for the parent folder ( = backup folder )
+::ucbhelper::Content  aContent;
+Reference  ::com::sun::star::ucb::XCommandEnvironment  xEnv;
+if( ensureFolder(comphelper::getProcessComponentContext(), xEnv, aBakDir, 
aContent) )
+DoInternalBackup_Impl( aOriginalContent, aPrefix, aExtension, aBakDir 
);
 
 if ( pImp-m_aBackupURL.isEmpty() )
 {
@@ -2167,7 +2190,7 @@ void SfxMedium::DoBackup_Impl()
 // create content for the parent folder ( = backup folder )
 ::ucbhelper::Content  aContent;
 Reference  ::com::sun::star::ucb::XCommandEnvironment  xEnv;
-if( ::ucbhelper::Content::create( aBakDir, xEnv, 
comphelper::getProcessComponentContext(), aContent ) )
+if( ensureFolder(comphelper::getProcessComponentContext(), xEnv, 
aBakDir, aContent) )
 {
 // save as .bak file
 INetURLObject aDest( aBakDir );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sfx2/source

2013-05-24 Thread Stephan Bergmann
 sfx2/source/doc/docfile.cxx |   15 +++
 1 file changed, 7 insertions(+), 8 deletions(-)

New commits:
commit dfe24cc4b1eb623753840523efb62c73e2b44afa
Author: Stephan Bergmann sberg...@redhat.com
Date:   Thu May 23 17:17:09 2013 +0200

rhbz#961460: Don't needlessly pass URLs through INetURLObject

The WebDAV UCP uses https/davs URLs that may contain a userinfo (cf. RFC 
3986)
part, and INetURLObject does not support that (in accordance with RFCs 2818 
and
2616) and thus creates an empty INET_PROT_NOT_VALID INetURLObject for such a
URL, leading to failure when trying to save a document to such a URL.
(Regression introduced with 966d20e35d5a2be2fce6c204af5c156c3ead7063 CMIS 
ucp:
write documents back to CMIS server.)

Change-Id: Ifd396852b211cab1d29575da7fccb32306479f93
(cherry picked from commit 3f5c45b70864af95a6362acf4684fb57eb85e348)
Reviewed-on: https://gerrit.libreoffice.org/4019
Tested-by: Caolán McNamara caol...@redhat.com
Reviewed-by: Caolán McNamara caol...@redhat.com

diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 3ce8ab7..d08f3fc 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -1936,6 +1936,7 @@ void SfxMedium::Transfer_Impl()
 
 ::ucbhelper::Content aDestContent;
 ::ucbhelper::Content::create( aDestURL, xComEnv, 
comphelper::getProcessComponentContext(), aDestContent );
+// For checkin, we need the object URL, not the parent folder:
 if ( !IsInCheckIn( ) )
 {
 // Get the parent URL from the XChild if possible: why would 
the URL necessarily have
@@ -1951,13 +1952,11 @@ void SfxMedium::Transfer_Impl()
 }
 }
 
-if ( !sParentUrl.isEmpty() )
-aDest = INetURLObject( sParentUrl );
-}
-else
-{
-// For checkin, we need the object URL, not the parent folder
-aDest = INetURLObject( aDestURL );
+if ( sParentUrl.isEmpty() )
+aDestURL = aDest.GetMainURL( INetURLObject::NO_DECODE );
+// adjust to above aDest.removeSegment()
+else
+aDestURL = sParentUrl;
 }
 
 // LongName wasn't defined anywhere, only used here... get the 
Title instead
@@ -1970,7 +1969,7 @@ void SfxMedium::Transfer_Impl()
 
 try
 {
-aTransferContent = ::ucbhelper::Content( aDest.GetMainURL( 
INetURLObject::NO_DECODE ), xComEnv, comphelper::getProcessComponentContext() );
+aTransferContent = ::ucbhelper::Content( aDestURL, xComEnv, 
comphelper::getProcessComponentContext() );
 }
 catch (const ::com::sun::star::ucb::ContentCreationException ex)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sfx2/source

2013-05-08 Thread Andras Timar
 sfx2/source/appl/sfxhelp.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit b8dd48c73c0d6978913e93af8ea8e0fae0b2c190
Author: Andras Timar ati...@suse.com
Date:   Tue May 7 21:01:30 2013 +0200

fdo#64211 replace %2F to / in online (wiki) help URLs

It is not possible to create wiki pages with URLs that have %2F in
them. Help URLs contain %2F, when invoked from dialogs that are
based on .ui files, it seems this is the new HID syntax.

For example for Zoom dialog LibreOffice used to call
http://help.libreoffice.org/simpress/cui%2Fui%2Fzoomdialog%2Fzoomsb
and it did not work. Now it calls
http://help.libreoffice.org/simpress/cui/ui/zoomdialog/zoomsb
and it works.

Signed-off-by: Miklos Vajna vmik...@suse.cz

Conflicts:

sfx2/source/appl/sfxhelp.cxx

Change-Id: I163cf8ec3b69f31eadbbd9085d2180839fe91e07

diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index b2be3e3..4e7837c 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -660,6 +660,7 @@ static bool impl_showOnlineHelp( const String rURL )
 
 OUString aHelpLink( http://help.libreoffice.org/;  );
 aHelpLink += rURL.Copy( aInternal.Len() );
+aHelpLink = aHelpLink.replaceAll(%2F,/);
 try
 {
 Reference XSystemShellExecute  xSystemShell(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sfx2/source

2013-04-22 Thread Noel Power
 sfx2/source/doc/zoomitem.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit fe3d1b7ab5ac2776b60efab0efbd6d832f63b655
Author: Noel Power noel.po...@suse.com
Date:   Mon Apr 22 10:29:02 2013 +0100

fdo#63659 sigh fix brain lapse, missing break

Change-Id: I02ab972cfad577423585d25587b925b5b1153506
(cherry picked from commit ad57664323e3ddf04ae99dba14ddaa22da2aacba)
Reviewed-on: https://gerrit.libreoffice.org/3551
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sfx2/source/doc/zoomitem.cxx b/sfx2/source/doc/zoomitem.cxx
index 09b2ae7..7849e59 100644
--- a/sfx2/source/doc/zoomitem.cxx
+++ b/sfx2/source/doc/zoomitem.cxx
@@ -120,6 +120,7 @@ bool SvxZoomItem::QueryValue( com::sun::star::uno::Any 
rVal, sal_uInt8 nMemberI
 aSeq[2].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( 
ZOOM_PARAM_TYPE ));
 aSeq[2].Value = sal_Int16( eType );
 rVal = aSeq;
+break;
 }
 
 case MID_VALUE: rVal = (sal_Int32) GetValue(); break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sfx2/source

2013-04-19 Thread Noel Power
 sfx2/source/doc/zoomitem.cxx |  124 +--
 1 file changed, 84 insertions(+), 40 deletions(-)

New commits:
commit b2a84e61e25679e63b5620e818c4532b64b2a4fc
Author: Noel Power noel.po...@suse.com
Date:   Thu Apr 18 11:54:42 2013 +0100

fix fdo#63659 restore handling of ZOOM MID, MID_VALUESET  MID_TYPE sub 
parmas

Change-Id: I01eff3bb8b194e1437a263e527cb8e6d2defa4de
Reviewed-on: https://gerrit.libreoffice.org/3458
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sfx2/source/doc/zoomitem.cxx b/sfx2/source/doc/zoomitem.cxx
index 888272a..09b2ae7 100644
--- a/sfx2/source/doc/zoomitem.cxx
+++ b/sfx2/source/doc/zoomitem.cxx
@@ -23,7 +23,7 @@
 #include sfx2/zoomitem.hxx
 #include com/sun/star/uno/Sequence.hxx
 #include com/sun/star/beans/PropertyValue.hpp
-
+#include sfx.hrc
 // ---
 
 TYPEINIT1_FACTORY(SvxZoomItem,SfxUInt16Item, new SvxZoomItem);
@@ -107,19 +107,28 @@ int SvxZoomItem::operator==( const SfxPoolItem rAttr ) 
const
 
 bool SvxZoomItem::QueryValue( com::sun::star::uno::Any rVal, sal_uInt8 
nMemberId ) const
 {
-//  sal_Bool bConvert = 0!=(nMemberIdCONVERT_TWIPS);
 nMemberId = ~CONVERT_TWIPS;
+switch( nMemberId )
+{
+case 0:
+{
+::com::sun::star::uno::Sequence 
::com::sun::star::beans::PropertyValue  aSeq( ZOOM_PARAMS );
+aSeq[0].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( 
ZOOM_PARAM_VALUE ));
+aSeq[0].Value = sal_Int32( GetValue() );
+aSeq[1].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( 
ZOOM_PARAM_VALUESET ));
+aSeq[1].Value = sal_Int16( nValueSet );
+aSeq[2].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( 
ZOOM_PARAM_TYPE ));
+aSeq[2].Value = sal_Int16( eType );
+rVal = aSeq;
+}
 
-assert(nMemberId == 0);
-
-::com::sun::star::uno::Sequence ::com::sun::star::beans::PropertyValue  
aSeq( ZOOM_PARAMS );
-aSeq[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 
ZOOM_PARAM_VALUE ));
-aSeq[0].Value = sal_Int32( GetValue() );
-aSeq[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( 
ZOOM_PARAM_VALUESET ));
-aSeq[1].Value = sal_Int16( nValueSet );
-aSeq[2].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ZOOM_PARAM_TYPE 
));
-aSeq[2].Value = sal_Int16( eType );
-rVal = aSeq;
+case MID_VALUE: rVal = (sal_Int32) GetValue(); break;
+case MID_VALUESET: rVal = (sal_Int16) nValueSet; break;
+case MID_TYPE: rVal = (sal_Int16) eType; break;
+default:
+OSL_FAIL(sfx2::SvxZoomItem::QueryValue(), Wrong MemberId!);
+return false;
+}
 
 return true;
 }
@@ -127,45 +136,80 @@ bool SvxZoomItem::QueryValue( com::sun::star::uno::Any 
rVal, sal_uInt8 nMemberI
 bool SvxZoomItem::PutValue( const com::sun::star::uno::Any rVal, sal_uInt8 
nMemberId )
 {
 nMemberId = ~CONVERT_TWIPS;
-assert(nMemberId == 0);
-
-::com::sun::star::uno::Sequence ::com::sun::star::beans::PropertyValue  
aSeq;
-if (( rVal = aSeq )  ( aSeq.getLength() == ZOOM_PARAMS ))
+switch( nMemberId )
 {
-sal_Int32 nValueTmp( 0 );
-sal_Int16 nValueSetTmp( 0 );
-sal_Int16 nTypeTmp( 0 );
-sal_Bool  bAllConverted( sal_True );
-sal_Int16 nConvertedCount( 0 );
-for ( sal_Int32 i = 0; i  aSeq.getLength(); i++ )
+case 0:
 {
-if ( aSeq[i].Name.equalsAscii( ZOOM_PARAM_VALUE ))
-{
-bAllConverted = ( aSeq[i].Value = nValueTmp );
-++nConvertedCount;
-}
-else if ( aSeq[i].Name.equalsAscii( ZOOM_PARAM_VALUESET ))
+::com::sun::star::uno::Sequence 
::com::sun::star::beans::PropertyValue  aSeq;
+if (( rVal = aSeq )  ( aSeq.getLength() == ZOOM_PARAMS ))
 {
-bAllConverted = ( aSeq[i].Value = nValueSetTmp );
-++nConvertedCount;
+sal_Int32 nValueTmp( 0 );
+sal_Int16 nValueSetTmp( 0 );
+sal_Int16 nTypeTmp( 0 );
+sal_Bool  bAllConverted( sal_True );
+sal_Int16 nConvertedCount( 0 );
+for ( sal_Int32 i = 0; i  aSeq.getLength(); i++ )
+{
+if ( aSeq[i].Name.equalsAscii( ZOOM_PARAM_VALUE ))
+{
+bAllConverted = ( aSeq[i].Value = nValueTmp );
+++nConvertedCount;
+}
+else if ( aSeq[i].Name.equalsAscii( ZOOM_PARAM_VALUESET ))
+{
+bAllConverted = ( aSeq[i].Value = nValueSetTmp );
+++nConvertedCount;
+}
+else if ( aSeq[i].Name.equalsAscii( ZOOM_PARAM_TYPE ))
+

[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sfx2/source

2013-04-15 Thread Rafael Dominguez
 sfx2/source/doc/templatedlg.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 7e16f5c0e8409aba10149501629b05bbcdd8939a
Author: Rafael Dominguez venccsra...@gmail.com
Date:   Wed Apr 10 10:25:31 2013 -0430

Set Template Manager dialog minimum size.

Change-Id: I2d30bf2c3fb33b8297477f80704aa057911a2bba
Reviewed-on: https://gerrit.libreoffice.org/3353
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index a5edb7b..82289ba 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -244,6 +244,8 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window 
*parent)
 mpViewBar-RemoveItem(nPos);
 }
 
+SetMinOutputSizePixel(GetOutputSizePixel());
+
 mpViewBar-Show();
 mpActionBar-Show();
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sfx2/source

2013-04-15 Thread Rafael Dominguez
 sfx2/source/control/templatelocalview.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 94cb2604ea75a504ecab5f500701099e00859b7c
Author: Rafael Dominguez venccsra...@gmail.com
Date:   Wed Apr 10 10:36:09 2013 -0430

Remove thumbnail from local view if we erase it throught the search view.

Change-Id: I3ec486313bedcc633b020a2feea3d30730da98f0
Reviewed-on: https://gerrit.libreoffice.org/3354
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sfx2/source/control/templatelocalview.cxx 
b/sfx2/source/control/templatelocalview.cxx
index 884897c..f1a3421 100644
--- a/sfx2/source/control/templatelocalview.cxx
+++ b/sfx2/source/control/templatelocalview.cxx
@@ -352,7 +352,11 @@ bool TemplateLocalView::removeTemplate (const sal_uInt16 
nItemId, const sal_uInt
 
 pIter = pItem-maTemplates.erase(pIter);
 
-RemoveItem(nItemId);
+if (maRegions[i]-mnRegionId == mnCurRegionId-1)
+{
+RemoveItem(nItemId);
+Invalidate();
+}
 
 // Update Doc Idx for all templates that follow
 for (; pIter != pItem-maTemplates.end(); ++pIter)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sfx2/source

2013-04-13 Thread Julien Nabet
 sfx2/source/doc/templatedlg.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 7fcfe8817c0cc896cb29de2613d9f43381d7b6ad
Author: Julien Nabet serval2...@yahoo.fr
Date:   Fri Mar 29 07:18:05 2013 +0100

Initialize nFilter

Change-Id: I9a8606a0d6ca36fd6f51267ea385f7fbe874d6d5
(cherry picked from commit 9f27436b84a1ae0ce2689ef27f81698ab9f3642e)

Signed-off-by: Eike Rathke er...@redhat.com

diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 3097f1f..a5edb7b 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -363,7 +363,7 @@ void SfxTemplateManagerDlg::readSettings ()
 
 if ( aViewSettings.Exists() )
 {
-sal_uInt16 nFilter;
+sal_uInt16 nFilter = 0;
 aViewSettings.GetUserItem(TM_SETTING_LASTFOLDER) = aLastFolder;
 aViewSettings.GetUserItem(TM_SETTING_FILTER) = nFilter;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sfx2/source

2013-04-02 Thread Julien Nabet
 sfx2/source/dialog/templdlg.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 4bd26ee5f1c16eed69f4521bc4fcedbaa6e1737b
Author: Julien Nabet serval2...@yahoo.fr
Date:   Sat Mar 30 19:42:48 2013 +0100

coverity#441020 Dereference after null check

Change-Id: I39c301a98854d19e849a9e06ffac0657408456fe
(cherry picked from commit cab7f6476f7d0f17bf2f1400bf93fb1b7fbd1625)

diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 94e8082..c551bac 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -2674,7 +2674,7 @@ void SfxCommonTemplateDialog_Impl::UpdateFamily_Impl()
 if ( pOldStyleSheetPool )
 EndListening(*pOldStyleSheetPool);
 if ( pStyleSheetPool )
-StartListening(*pOldStyleSheetPool);
+StartListening(*pStyleSheetPool);
 }
 
 bWaterDisabled = sal_False;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sfx2/source

2013-03-28 Thread Rafael Dominguez
 sfx2/source/control/thumbnailview.cxx |   10 ++
 1 file changed, 10 insertions(+)

New commits:
commit 141ad5a104b41445a09e7aad57bd68ccb4207798
Author: Rafael Dominguez venccsra...@gmail.com
Date:   Mon Mar 25 21:28:20 2013 -0430

Deselect thumbnailview items when clearing the view.

Change-Id: I8aa3f61d3ec7a8bf6195c5480b82d1dc1ecabc34
(cherry picked from commit 1c9f13f921cb5bf955b8568ffb5d14047738eef9)
Reviewed-on: https://gerrit.libreoffice.org/3089
Reviewed-by: Miklos Vajna vmik...@suse.cz
Tested-by: Miklos Vajna vmik...@suse.cz

diff --git a/sfx2/source/control/thumbnailview.cxx 
b/sfx2/source/control/thumbnailview.cxx
index ca685cc..b3b1251 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -114,6 +114,16 @@ void ThumbnailView::ImplDeleteItems()
 for ( size_t i = 0; i  n; ++i )
 {
 ThumbnailViewItem *const pItem = mItemList[i];
+
+// deselect all current selected items and fire events
+if (pItem-isSelected())
+{
+pItem-setSelection(false);
+maItemStateHdl.Call(pItem);
+
+// fire accessible event???
+}
+
 if ( pItem-isVisible()  ImplHasAccessibleListeners() )
 {
 ::com::sun::star::uno::Any aOldAny, aNewAny;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sfx2/source

2013-03-28 Thread Rafael Dominguez
 sfx2/source/control/thumbnailview.cxx |   23 ++-
 1 file changed, 14 insertions(+), 9 deletions(-)

New commits:
commit 82a320dbb30e843ef5e69ec82be7179a8fba28bc
Author: Rafael Dominguez venccsra...@gmail.com
Date:   Mon Mar 25 22:32:32 2013 -0430

Fix template manager item selection behaviour with mouse.

Change-Id: Icf63454973b403eea1cc583fce3a78c5594d
(cherry picked from commit 28d5ced7f9982257d263ffc3e550bd479a9542f8)
Reviewed-on: https://gerrit.libreoffice.org/3090
Reviewed-by: Miklos Vajna vmik...@suse.cz
Tested-by: Miklos Vajna vmik...@suse.cz

diff --git a/sfx2/source/control/thumbnailview.cxx 
b/sfx2/source/control/thumbnailview.cxx
index b3b1251..8b2840d 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -609,15 +609,22 @@ void ThumbnailView::MouseButtonDown( const MouseEvent 
rMEvt )
 {
 if ( rMEvt.GetClicks() == 1 )
 {
-if (pItem-isSelected()  rMEvt.IsMod1())
-pItem-setSelection(false);
+if (rMEvt.IsMod1())
+{
+//Keep selected item group state and just invert current 
desired one state
+pItem-setSelection(!pItem-isSelected());
+}
 else
 {
-if (!pItem-isSelected()  !rMEvt.IsMod1())
-deselectItems( );
-
+//If we got a group of selected items deselect the rest 
and only keep the desired one
+//mark items as not selected to not fire unnecessary 
change state events.
+pItem-setSelection(false);
+deselectItems();
 pItem-setSelection(true);
+}
 
+if (pItem-isSelected())
+{
 bool bClickOnTitle = 
pItem-getTextArea().IsInside(rMEvt.GetPosPixel());
 pItem-setEditTitle(bClickOnTitle);
 }
@@ -626,13 +633,11 @@ void ThumbnailView::MouseButtonDown( const MouseEvent 
rMEvt )
 DrawItem(pItem);
 
 maItemStateHdl.Call(pItem);
+
+//fire accessible event??
 }
 else if ( rMEvt.GetClicks() == 2 )
 {
-// The mouse button down event 1 click right before is 
pointless
-pItem-setSelection(false);
-maItemStateHdl.Call(pItem);
-
 Rectangle aRect(pItem-getDrawArea());
 
 if (aRect.IsInside(rMEvt.GetPosPixel()))
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sfx2/source

2013-03-28 Thread Stephan Bergmann
 sfx2/source/doc/templatedlg.cxx |   22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

New commits:
commit 60e8f1f5f44a140fc044d7178198adba5acbe32d
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Mar 26 17:35:01 2013 +0100

quickfix

Change-Id: Ida36d96982d869553452c8240da7dec363cee4b4
Signed-off-by: Luboš Luňák l.lu...@suse.cz

diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index c87030c..f993ecf 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -842,7 +842,7 @@ void SfxTemplateManagerDlg::OnTemplateImport ()
 
 if (aFiles.hasElements())
 {
-std::setconst ThumbnailViewItem*::const_iterator pIter;
+std::setconst 
ThumbnailViewItem*,selection_cmp_fn::const_iterator pIter;
 for (pIter = maSelFolders.begin(); pIter != maSelFolders.end(); 
++pIter)
 {
 OUString aTemplateList;
@@ -891,7 +891,7 @@ void SfxTemplateManagerDlg::OnTemplateExport()
 {
 sal_uInt16 i = 1;
 
-std::setconst ThumbnailViewItem*::const_iterator pIter = 
maSelTemplates.begin();
+std::setconst 
ThumbnailViewItem*,selection_cmp_fn::const_iterator pIter = 
maSelTemplates.begin();
 for (pIter = maSelTemplates.begin(); pIter != 
maSelTemplates.end(); ++pIter, ++i)
 {
 const TemplateSearchViewItem *pItem = static_castconst 
TemplateSearchViewItem*(*pIter);
@@ -923,7 +923,7 @@ void SfxTemplateManagerDlg::OnTemplateExport()
 sal_uInt16 i = 1;
 sal_uInt16 nRegionItemId = maView-getCurRegionId() + 1;
 
-std::setconst ThumbnailViewItem*::const_iterator pIter = 
maSelTemplates.begin();
+std::setconst 
ThumbnailViewItem*,selection_cmp_fn::const_iterator pIter = 
maSelTemplates.begin();
 for (pIter = maSelTemplates.begin(); pIter != 
maSelTemplates.end(); ++pIter, ++i)
 {
 const TemplateViewItem *pItem = static_castconst 
TemplateViewItem*(*pIter);
@@ -1010,7 +1010,7 @@ void SfxTemplateManagerDlg::OnTemplateEdit ()
 aArgs[2].Value = UpdateDocMode::ACCORDING_TO_CONFIG;
 
 uno::Reference XStorable  xStorable;
-std::setconst ThumbnailViewItem*::const_iterator pIter;
+std::setconst ThumbnailViewItem*,selection_cmp_fn::const_iterator pIter;
 for (pIter = maSelTemplates.begin(); pIter != maSelTemplates.end(); 
++pIter)
 {
 const TemplateViewItem *pItem = static_castconst 
TemplateViewItem*(*pIter);
@@ -1044,7 +1044,7 @@ void SfxTemplateManagerDlg::OnTemplateDelete ()
 
 if (mpSearchView-IsVisible())
 {
-std::setconst ThumbnailViewItem*::const_iterator pIter;
+std::setconst ThumbnailViewItem*,selection_cmp_fn::const_iterator 
pIter;
 for (pIter = maSelTemplates.begin(); pIter != maSelTemplates.end();)
 {
 const TemplateSearchViewItem *pItem =
@@ -1078,7 +1078,7 @@ void SfxTemplateManagerDlg::OnTemplateDelete ()
 }
 else
 {
-std::setconst ThumbnailViewItem*::const_iterator pIter;
+std::setconst ThumbnailViewItem*,selection_cmp_fn::const_iterator 
pIter;
 for (pIter = maSelTemplates.begin(); pIter != maSelTemplates.end();)
 {
 if 
(maView-removeTemplate((*pIter)-mnId,maView-getCurRegionId()+1))
@@ -1135,7 +1135,7 @@ void SfxTemplateManagerDlg::OnFolderDelete()
 
 OUString aFolderList;
 
-std::setconst ThumbnailViewItem*::const_iterator pIter;
+std::setconst ThumbnailViewItem*,selection_cmp_fn::const_iterator pIter;
 for (pIter = maSelFolders.begin(); pIter != maSelFolders.end();)
 {
 if (maView-removeRegion((*pIter)-mnId))
@@ -1215,7 +1215,7 @@ void SfxTemplateManagerDlg::OnTemplateSaveAs()
 }
 else
 {
-std::setconst ThumbnailViewItem*::const_iterator pIter;
+std::setconst 
ThumbnailViewItem*,selection_cmp_fn::const_iterator pIter;
 for (pIter = maSelFolders.begin(); pIter != 
maSelFolders.end(); ++pIter)
 {
 TemplateContainerItem *pItem = 
(TemplateContainerItem*)(*pIter);
@@ -1347,7 +1347,7 @@ void SfxTemplateManagerDlg::localMoveTo(sal_uInt16 
nMenuId)
 {
 OUString aTemplateList;
 
-std::setconst ThumbnailViewItem*::const_iterator pIter;
+std::setconst 
ThumbnailViewItem*,selection_cmp_fn::const_iterator pIter;
 for (pIter = maSelFolders.begin(); pIter != maSelFolders.end(); 
++pIter)
 {
 if (aTemplateList.isEmpty())
@@ -1391,7 +1391,7 @@ void SfxTemplateManagerDlg::remoteMoveTo(const sal_uInt16 
nMenuId)
 {
 OUString aTemplateList;
 
-std::setconst ThumbnailViewItem*::const_iterator aIter;
+std::setconst ThumbnailViewItem*,selection_cmp_fn::const_iterator 
aIter;
 for (aIter = 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sfx2/source svl/inc

2013-03-27 Thread Michael Stahl
 sfx2/source/dialog/templdlg.cxx |   54 
 sfx2/source/inc/templdgi.hxx|2 +
 svl/inc/svl/style.hrc   |1 
 3 files changed, 42 insertions(+), 15 deletions(-)

New commits:
commit 5c5b6f1e9e3341726d6870af74912bb9db374b5f
Author: Michael Stahl mst...@redhat.com
Date:   Tue Mar 26 11:33:09 2013 +0100

fdo#61429: Stylist: save selection of Hierarchical entry

This is unfortunately rather ugly because that one is very special.

(cherry picked from commit 44dd8b838b8dfa74b895a870a68200cf4f3574e0)

Conflicts:
sfx2/source/dialog/templdlg.cxx

Change-Id: Ie2bc9ce2690fbc742b4510e453ca1ef310614256
Reviewed-on: https://gerrit.libreoffice.org/3056
Reviewed-by: Christoph Brill egore...@gmail.com
Reviewed-by: Bosdonnat Cedric cedric.bosdon...@free.fr
Tested-by: Bosdonnat Cedric cedric.bosdon...@free.fr

diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index a81c27d..94e8082 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -753,6 +753,7 @@ SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl( 
SfxBindings* pB, Sfx
 bUpdateByExampleDisabled( sal_False ),
 bTreeDrag   ( sal_True ),
 bHierarchical   ( sal_False ),
+m_bWantHierarchical ( sal_False ),
 bBindingUpdate  ( sal_True )
 {
 aFmtLb.SetAccessibleName(SfxResId(STR_STYLE_ELEMTLIST).toString());
@@ -1278,8 +1279,10 @@ void 
SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(sal_uInt16 nFlags)
 }
 
 // if the tree view again, select family hierarchy
-if(pTreeBox)
+if (pTreeBox || m_bWantHierarchical)
+{
 
aFilterLb.SelectEntry(SfxResId(STR_STYLE_FILTER_HIERARCHICAL).toString());
+}
 
 // show maximum 14 entries
 aFilterLb.SetDropDownLineCount( MAX_FILTER_ENTRIES );
@@ -1287,12 +1290,21 @@ void 
SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(sal_uInt16 nFlags)
 }
 else
 {
-if( nActFilter  aFilterLb.GetEntryCount() - 1)
-aFilterLb.SelectEntryPos(nActFilter + 1);
-else
+if (m_bWantHierarchical)
 {
 nActFilter = 0;
-aFilterLb.SelectEntryPos(1);
+aFilterLb.SelectEntry(SfxResId(
+STR_STYLE_FILTER_HIERARCHICAL).toString());
+}
+else
+{
+if (nActFilter  aFilterLb.GetEntryCount() - 1)
+aFilterLb.SelectEntryPos(nActFilter + 1);
+else
+{
+nActFilter = 0;
+aFilterLb.SelectEntryPos(1);
+}
 }
 }
 
@@ -1635,7 +1647,6 @@ void SfxCommonTemplateDialog_Impl::Notify(SfxBroadcaster 
/*rBC*/, const SfxHint
 
 
 //-
-
 // Other filters; can be switched by the users or as a result of new or
 // editing, if the current document has been assigned a different filter.
 void SfxCommonTemplateDialog_Impl::FilterSelect(
@@ -1646,14 +1657,7 @@ void SfxCommonTemplateDialog_Impl::FilterSelect(
 if( nEntry != nActFilter || bForce )
 {
 nActFilter = nEntry;
-SfxViewFrame *pViewFrame = pBindings-GetDispatcher_Impl()-GetFrame();
-SfxObjectShell *pDocShell = pViewFrame-GetObjectShell();
-if (pDocShell)
-{
-pDocShell-SetAutoStyleFilterIndex(nActFilter);
-SaveFactoryStyleFilter( pDocShell, nActFilter );
-}
-
+SfxObjectShell *const pDocShell = SaveSelection();
 SfxStyleSheetBasePool *pOldStyleSheetPool = pStyleSheetPool;
 pStyleSheetPool = pDocShell? pDocShell-GetStyleSheetPool(): 0;
 if ( pOldStyleSheetPool != pStyleSheetPool )
@@ -1744,6 +1748,8 @@ IMPL_LINK( SfxCommonTemplateDialog_Impl, FilterSelectHdl, 
ListBox *, pBox )
 {
 // Turn on treeView
 bHierarchical=sal_True;
+m_bWantHierarchical = sal_True;
+SaveSelection(); // fdo#61429 store hierarchical
 const String aSelectEntry( GetSelectedEntry());
 aFmtLb.Hide();
 
@@ -1776,6 +1782,7 @@ IMPL_LINK( SfxCommonTemplateDialog_Impl, FilterSelectHdl, 
ListBox *, pBox )
 aFmtLb.Show();
 // If bHierarchical, then the family can have changed
 // minus one since hierarchical is inserted at the start
+m_bWantHierarchical = sal_False; // before FilterSelect
 FilterSelect(pBox-GetSelectEntryPos() - 1, bHierarchical );
 bHierarchical=sal_False;
 }
@@ -1918,6 +1925,10 @@ sal_Int32 
SfxCommonTemplateDialog_Impl::LoadFactoryStyleFilter( SfxObjectShell*
 sal_Int32 nDefault = -1;
 nFilter = aFactoryProps.getUnpackedValueOrDefault( 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sfx2/source

2013-03-26 Thread Cédric Bosdonnat
 sfx2/source/control/thumbnailview.cxx |   22 +-
 1 file changed, 13 insertions(+), 9 deletions(-)

New commits:
commit edc8b07e5f69413b3710ddf192a84a862b0e17af
Author: Cédric Bosdonnat cedric.bosdon...@free.fr
Date:   Mon Mar 25 17:58:49 2013 +0100

fdo#62659: only select items in ThumbnailView on TabStop

Change-Id: I024df8520f0daf2cc2e9e5f041e1ff18cb3689ec
(cherry picked from commit f8a3582d4cbcf6a705f724b921e370c739ecee35)
Reviewed-on: https://gerrit.libreoffice.org/3034
Reviewed-by: Miklos Vajna vmik...@suse.cz
Tested-by: Miklos Vajna vmik...@suse.cz

diff --git a/sfx2/source/control/thumbnailview.cxx 
b/sfx2/source/control/thumbnailview.cxx
index 08be7cb..0da633f 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -126,6 +126,7 @@ void ThumbnailView::ImplDeleteItems()
 }
 
 mItemList.clear();
+mFilteredItemList.clear();
 }
 
 void ThumbnailView::ImplInitSettings( bool bFont, bool bForeground, bool 
bBackground )
@@ -680,17 +681,20 @@ void ThumbnailView::Paint( const Rectangle aRect)
 
 void ThumbnailView::GetFocus()
 {
-// Select the first item if nothing selected
-int nSelected = -1;
-for (size_t i = 0, n = mItemList.size(); i  n  nSelected == -1; ++i)
+if(GETFOCUS_TAB  GetGetFocusFlags())
 {
-if (mItemList[i]-isSelected())
-nSelected = i;
-}
+// Select the first item if nothing selected
+int nSelected = -1;
+for (size_t i = 0, n = mItemList.size(); i  n  nSelected == -1; ++i)
+{
+if (mItemList[i]-isSelected())
+nSelected = i;
+}
 
-if ( nSelected == -1  mItemList.size( )  0 )
-{
-SelectItem( 1 );
+if ( nSelected == -1  mItemList.size( )  0 )
+{
+SelectItem( 1 );
+}
 }
 
 // Tell the accessible object that we got the focus.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sfx2/source

2013-03-22 Thread Cédric Bosdonnat
 sfx2/source/control/thumbnailview.cxx |   19 ++-
 1 file changed, 18 insertions(+), 1 deletion(-)

New commits:
commit 8396ef6b53bc2363aff158be34eeb93cd21fc2be
Author: Cédric Bosdonnat cedric.bosdon...@free.fr
Date:   Wed Mar 20 17:06:31 2013 +0100

Template Manager: select first item when getting focus if no selection

Change-Id: Ie012e010ca92728725535345c76fc9f5eb31a254
(cherry picked from commit ec2f84b376f595b0553297d25b7716f6b97e1b87)
Reviewed-on: https://gerrit.libreoffice.org/2910
Reviewed-by: Michael Meeks michael.me...@suse.com
Tested-by: Michael Meeks michael.me...@suse.com

diff --git a/sfx2/source/control/thumbnailview.cxx 
b/sfx2/source/control/thumbnailview.cxx
index c996f0f..57dba07 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -579,12 +579,29 @@ void ThumbnailView::Paint( const Rectangle aRect)
 
 void ThumbnailView::GetFocus()
 {
-Control::GetFocus();
+// Select the first item if nothing selected
+int nSelected = -1;
+for (size_t i = 0, n = mItemList.size(); i  n  nSelected == -1; ++i)
+{
+if (mItemList[i]-isSelected())
+nSelected = i;
+}
+
+if ( nSelected == -1  mItemList.size( )  0 )
+{
+mItemList[0]-setSelection(true);
+maItemStateHdl.Call(mItemList[0]);
+
+if (IsReallyVisible()  IsUpdateMode())
+Invalidate();
+}
 
 // Tell the accessible object that we got the focus.
 ThumbnailViewAcc* pAcc = ThumbnailViewAcc::getImplementation( 
GetAccessible( sal_False ) );
 if( pAcc )
 pAcc-GetFocus();
+
+Control::GetFocus();
 }
 
 void ThumbnailView::LoseFocus()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sfx2/source

2013-03-22 Thread Cédric Bosdonnat
 sfx2/source/doc/templatedlg.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 617b885df741da12535b14798ee101872476f7bc
Author: Cédric Bosdonnat cedric.bosdon...@free.fr
Date:   Wed Mar 20 16:03:29 2013 +0100

Template Manager: fixed control WinBits reset... was breaking tabstop

Change-Id: I6e542ecc0e0f5a2b3e0ca59a52bb809b1a23284f
(cherry picked from commit 5fa5f95612c53511fb951660b4ad397321e8)
Reviewed-on: https://gerrit.libreoffice.org/2909
Reviewed-by: Petr Mladek pmla...@suse.cz
Tested-by: Petr Mladek pmla...@suse.cz

diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index e9f85eb..b9d3945 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -163,7 +163,7 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window 
*parent)
 
mpSearchEdit-SetUpdateDataHdl(LINK(this,SfxTemplateManagerDlg,SearchUpdateHdl));
 mpSearchEdit-EnableUpdateData();
 
-maView-SetStyle(WB_VSCROLL);
+maView-SetStyle(maView-GetStyle() | WB_VSCROLL);
 maView-setItemMaxTextLength(TEMPLATE_ITEM_MAX_TEXT_LENGTH);
 
 
maView-setItemDimensions(TEMPLATE_ITEM_MAX_WIDTH,TEMPLATE_ITEM_THUMBNAIL_MAX_HEIGHT,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sfx2/source

2013-03-11 Thread Joren De Cuyper
 sfx2/source/dialog/templdlg.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit a9e2b90fd4458852e745ec5eca127549452617b7
Author: Joren De Cuyper joren.libreoff...@telenet.be
Date:   Sun Mar 10 12:48:30 2013 +0100

fdo#62075 Hierarchical filter hard to find

See UX-advice 
http://lists.freedesktop.org/archives/libreoffice-ux-advise/2013-March/001898.html
and comment on bug for approval of ux-advice.

Change-Id: Ie5af5ec141b148e6253d0ffa9b546d30994c6dd6
Reviewed-on: https://gerrit.libreoffice.org/2639
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 0af6d77..a81c27d 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -83,8 +83,8 @@ using namespace ::com::sun::star::uno;
 
 static sal_uInt16 nLastItemId = USHRT_MAX;
 
-// filter box has maximum 12 entries visible
-#define MAX_FILTER_ENTRIES  12
+// filter box has maximum 14 entries visible
+#define MAX_FILTER_ENTRIES  14
 
 //=
 
@@ -1281,7 +1281,7 @@ void 
SfxCommonTemplateDialog_Impl::UpdateStyles_Impl(sal_uInt16 nFlags)
 if(pTreeBox)
 
aFilterLb.SelectEntry(SfxResId(STR_STYLE_FILTER_HIERARCHICAL).toString());
 
-// show maximum 12 entries
+// show maximum 14 entries
 aFilterLb.SetDropDownLineCount( MAX_FILTER_ENTRIES );
 aFilterLb.SetUpdateMode(sal_True);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sfx2/source

2013-03-11 Thread Rafael Dominguez
 sfx2/source/doc/templatedlg.cxx |5 +
 sfx2/source/doc/templatedlg.hrc |1 +
 sfx2/source/doc/templatedlg.src |5 +
 3 files changed, 11 insertions(+)

New commits:
commit 1847de945a2b4ca66c02d19621404c567ee3b5be
Author: Rafael Dominguez venccsra...@gmail.com
Date:   Sun Mar 10 22:50:16 2013 -0430

Ask for confirmation when deleting a template, fdo#61466

Change-Id: Iaa499bfa5536d8df1d4e6d2aed3c350c588a0c46
(cherry picked from commit aac44d9c424861814e81d18b75b6ef315762ccce)

diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 7041966..2ff1b05 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -1019,6 +1019,11 @@ void SfxTemplateManagerDlg::OnTemplateProperties ()
 
 void SfxTemplateManagerDlg::OnTemplateDelete ()
 {
+QueryBox aQueryDlg(this, WB_YES_NO | WB_DEF_YES, 
SfxResId(STR_QMSG_SEL_TEMPLATE_DELETE).toString());
+
+if ( aQueryDlg.Execute() == RET_NO )
+return;
+
 OUString aTemplateList;
 
 if (mpSearchView-IsVisible())
diff --git a/sfx2/source/doc/templatedlg.hrc b/sfx2/source/doc/templatedlg.hrc
index 672575c..abddcd9 100644
--- a/sfx2/source/doc/templatedlg.hrc
+++ b/sfx2/source/doc/templatedlg.hrc
@@ -71,6 +71,7 @@
 
 #define STR_QMSG_SEL_FOLDER_DELETE  289
 #define STR_QMSG_TEMPLATE_OVERWRITE 290
+#define STR_QMSG_SEL_TEMPLATE_DELETE291
 
 #define IMG_ACTION_SORT 304
 #define IMG_ACTION_REFRESH  305
diff --git a/sfx2/source/doc/templatedlg.src b/sfx2/source/doc/templatedlg.src
index a351431..28b6963 100644
--- a/sfx2/source/doc/templatedlg.src
+++ b/sfx2/source/doc/templatedlg.src
@@ -101,6 +101,11 @@ String STR_QMSG_TEMPLATE_OVERWRITE
 Text [ en-US ] = A template named $1 already exist in $2. Do you want to 
overwrite it?;
 };
 
+String STR_QMSG_SEL_TEMPLATE_DELETE
+{
+Text [ en-US ] = Do you want to delete the selected templates?;
+};
+
 ModelessDialog DLG_TEMPLATE_MANAGER
 {
 OutputSize = TRUE;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sfx2/source

2013-03-11 Thread Cédric Bosdonnat
 sfx2/source/doc/templatedlg.cxx |5 -
 sfx2/source/doc/templatedlg.hrc |1 -
 sfx2/source/doc/templatedlg.src |5 -
 3 files changed, 11 deletions(-)

New commits:
commit 0708ce5b862bbb052f0d50bc4d1e931ff20952e4
Author: Cédric Bosdonnat cedric.bosdon...@free.fr
Date:   Mon Mar 11 16:49:09 2013 +0100

Revert Ask for confirmation when deleting a template, fdo#61466

This reverts commit 1847de945a2b4ca66c02d19621404c567ee3b5be. This
commit was introducing a new string... my bad, shouldn't have pushed it
in libreoffice-4-0 in the first time.

diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 2ff1b05..7041966 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -1019,11 +1019,6 @@ void SfxTemplateManagerDlg::OnTemplateProperties ()
 
 void SfxTemplateManagerDlg::OnTemplateDelete ()
 {
-QueryBox aQueryDlg(this, WB_YES_NO | WB_DEF_YES, 
SfxResId(STR_QMSG_SEL_TEMPLATE_DELETE).toString());
-
-if ( aQueryDlg.Execute() == RET_NO )
-return;
-
 OUString aTemplateList;
 
 if (mpSearchView-IsVisible())
diff --git a/sfx2/source/doc/templatedlg.hrc b/sfx2/source/doc/templatedlg.hrc
index abddcd9..672575c 100644
--- a/sfx2/source/doc/templatedlg.hrc
+++ b/sfx2/source/doc/templatedlg.hrc
@@ -71,7 +71,6 @@
 
 #define STR_QMSG_SEL_FOLDER_DELETE  289
 #define STR_QMSG_TEMPLATE_OVERWRITE 290
-#define STR_QMSG_SEL_TEMPLATE_DELETE291
 
 #define IMG_ACTION_SORT 304
 #define IMG_ACTION_REFRESH  305
diff --git a/sfx2/source/doc/templatedlg.src b/sfx2/source/doc/templatedlg.src
index 28b6963..a351431 100644
--- a/sfx2/source/doc/templatedlg.src
+++ b/sfx2/source/doc/templatedlg.src
@@ -101,11 +101,6 @@ String STR_QMSG_TEMPLATE_OVERWRITE
 Text [ en-US ] = A template named $1 already exist in $2. Do you want to 
overwrite it?;
 };
 
-String STR_QMSG_SEL_TEMPLATE_DELETE
-{
-Text [ en-US ] = Do you want to delete the selected templates?;
-};
-
 ModelessDialog DLG_TEMPLATE_MANAGER
 {
 OutputSize = TRUE;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sfx2/source

2013-03-08 Thread Niklas Johansson
 sfx2/source/doc/templatedlg.cxx |   17 ++---
 1 file changed, 14 insertions(+), 3 deletions(-)

New commits:
commit 7e7a591c275bda74833fd794ccd66496aa03d6af
Author: Niklas Johansson sleeping.pil...@gmail.com
Date:   Thu Feb 28 02:31:55 2013 +0100

Template manager should respect users macro/link settings.

When opening a file with loadComponentFromURL, macro and link settings
is not respected unless it's explicitly told to do so.

Change-Id: Iaf2f2a797285e40147152ac8dfd53720dc26931b
(cherry picked from commit 27f93b3b851e59d254bf5cd3825c8691d0ff3b51)

diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index c14a824..fa7b52b 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -40,6 +40,8 @@
 #include vcl/toolbox.hxx
 
 #include com/sun/star/beans/PropertyValue.hpp
+#include com/sun/star/document/MacroExecMode.hpp
+#include com/sun/star/document/UpdateDocMode.hpp
 #include com/sun/star/embed/XStorage.hpp
 #include com/sun/star/embed/ElementModes.hpp
 #include com/sun/star/frame/XComponentLoader.hpp
@@ -62,6 +64,7 @@ using namespace ::com::sun::star::frame;
 using namespace ::com::sun::star::lang;
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::ui::dialogs;
+using namespace ::com::sun::star::document;
 
 static bool lcl_getServiceName (const OUString rFileURL, OUString rName );
 
@@ -673,9 +676,13 @@ IMPL_LINK(SfxTemplateManagerDlg, OpenTemplateHdl, 
ThumbnailViewItem*, pItem)
 {
 if (!mbIsSaveMode)
 {
-uno::Sequence PropertyValue  aArgs(1);
+uno::Sequence PropertyValue  aArgs(3);
 aArgs[0].Name = AsTemplate;
-aArgs[0].Value = sal_True;
+aArgs[0].Value = sal_False;
+aArgs[1].Name = MacroExecutionMode;
+aArgs[1].Value = MacroExecMode::USE_CONFIG;
+aArgs[2].Name = UpdateDocMode;
+aArgs[2].Value = UpdateDocMode::ACCORDING_TO_CONFIG;
 
 TemplateViewItem *pTemplateItem = 
static_castTemplateViewItem*(pItem);
 
@@ -973,9 +980,13 @@ void SfxTemplateManagerDlg::OnTemplateSearch ()
 
 void SfxTemplateManagerDlg::OnTemplateEdit ()
 {
-uno::Sequence PropertyValue  aArgs(1);
+uno::Sequence PropertyValue  aArgs(3);
 aArgs[0].Name = AsTemplate;
 aArgs[0].Value = sal_False;
+aArgs[1].Name = MacroExecutionMode;
+aArgs[1].Value = MacroExecMode::USE_CONFIG;
+aArgs[2].Name = UpdateDocMode;
+aArgs[2].Value = UpdateDocMode::ACCORDING_TO_CONFIG;
 
 uno::Reference XStorable  xStorable;
 std::setconst ThumbnailViewItem*::const_iterator pIter;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sfx2/source

2013-03-08 Thread Niklas Johansson
 sfx2/source/doc/templatedlg.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 29fecdb19906ad4c6463d4a47de073ff36c1274c
Author: Niklas Johansson sleeping.pil...@gmail.com
Date:   Fri Mar 8 16:49:46 2013 +0100

A template it should create a new document not open in edit mode

I did a misstake in a previous patch. This patch fixes that.

Change-Id: I22c2ff8a03c5652717a8705474f2cbe3b5b9208b

diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index fa7b52b..7041966 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -678,7 +678,7 @@ IMPL_LINK(SfxTemplateManagerDlg, OpenTemplateHdl, 
ThumbnailViewItem*, pItem)
 {
 uno::Sequence PropertyValue  aArgs(3);
 aArgs[0].Name = AsTemplate;
-aArgs[0].Value = sal_False;
+aArgs[0].Value = sal_True;
 aArgs[1].Name = MacroExecutionMode;
 aArgs[1].Value = MacroExecMode::USE_CONFIG;
 aArgs[2].Name = UpdateDocMode;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sfx2/source

2013-02-28 Thread Andras Timar
 sfx2/source/dialog/mgetempl.src |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 916957b42a6f2ac5b82e90856961ebcc54f8e799
Author: Andras Timar ati...@suse.com
Date:   Thu Feb 28 16:00:00 2013 +0100

fdo#61453 fix truncation on German UI

Change-Id: I4ec173dc2856a6208f1149a5a9cbfc18873d1f2e
Reviewed-on: https://gerrit.libreoffice.org/2469
Reviewed-by: Caolán McNamara caol...@redhat.com
Tested-by: Caolán McNamara caol...@redhat.com

diff --git a/sfx2/source/dialog/mgetempl.src b/sfx2/source/dialog/mgetempl.src
index 218883d..ac03fb0 100644
--- a/sfx2/source/dialog/mgetempl.src
+++ b/sfx2/source/dialog/mgetempl.src
@@ -43,7 +43,7 @@ TabPage TP_MANAGE_STYLES
 MultiLineEdit MLE_NAME
 {
 Pos = MAP_APPFONT ( 70 , 8  ) ;
-Size = MAP_APPFONT ( 80 , 12 ) ;
+Size = MAP_APPFONT ( 184 , 12 ) ;
 Border = FALSE;
 ReadOnly = TRUE;
 Hide = TRUE;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sfx2/source

2013-02-12 Thread Cédric Bosdonnat
 sfx2/source/doc/doctemplates.cxx |   15 +--
 1 file changed, 13 insertions(+), 2 deletions(-)

New commits:
commit df37dd7d3ce201d1ba5a0065c126db107ce18ead
Author: Cédric Bosdonnat cedric.bosdon...@free.fr
Date:   Mon Feb 11 15:24:23 2013 +0100

Fixed SfxDocTplService_Impl::setTitleForURL to keep all streams.

After commit 117fdb98, the setTitleForURL only wrote the meta.xml file
to the odf container, dropping all the other streams. Use storeToStorage
as in the old implementation to fix the problem.

Even though marginal, this problem is important for templates renaming.

Change-Id: Ia9b6abfc112f102e2bd2ae9d3080c4ed827200df
Reviewed-on: https://gerrit.libreoffice.org/2107
Reviewed-by: Tor Lillqvist t...@iki.fi
Tested-by: Tor Lillqvist t...@iki.fi

diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index 1313fee..9720fab 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -32,6 +32,7 @@
 #include comphelper/componentcontext.hxx
 #include comphelper/processfactory.hxx
 #include comphelper/sequenceashashmap.hxx
+#include comphelper/storagehelper.hxx
 #include comphelper/string.hxx
 #include com/sun/star/beans/PropertyAttribute.hpp
 #include com/sun/star/beans/XPropertySet.hpp
@@ -646,8 +647,18 @@ sal_Bool SfxDocTplService_Impl::setTitleForURL( const 
OUString rURL, const OUSt
 try
 {
 m_xDocProps-loadFromMedium(rURL, SequencePropertyValue());
-m_xDocProps-setTitle(aTitle );
-m_xDocProps-storeToMedium(rURL, SequencePropertyValue());
+m_xDocProps-setTitle(aTitle);
+
+uno::Reference embed::XStorage  xStorage = 
::comphelper::OStorageHelper::GetStorageFromURL(
+rURL, embed::ElementModes::READWRITE);
+
+uno::Sequencebeans::PropertyValue medium(2);
+medium[0].Name = ::rtl::OUString(DocumentBaseURL);
+medium[0].Value = rURL;
+medium[1].Name = ::rtl::OUString(URL);
+medium[1].Value = rURL;
+
+m_xDocProps-storeToStorage(xStorage, medium);
 return true;
 }
 catch ( Exception )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sfx2/source

2013-02-05 Thread Caolán McNamara
 sfx2/source/control/dispatch.cxx |   18 ++
 1 file changed, 14 insertions(+), 4 deletions(-)

New commits:
commit 153afd7bf078b4d6992720186df987867f47acf1
Author: Caolán McNamara caol...@redhat.com
Date:   Tue Feb 5 09:53:24 2013 +

Resolves: fdo#60144 only delete *unposted* SfxRequests accumulated during 
lock

When the dispatched is locked, SfxRequests accumulate in aReqArr for later
dispatch when unlocked via Post

The pointers are typically deleted in Post, so only if we never get around 
to
posting them do we delete the unposted requests.

regression from 528aba3a9cf91da5ce70c6d631d7b82e203f8086

Change-Id: I4c214791d356ce0e5401a87b968b53e4866f6174
(cherry picked from commit 1385896fe760fe61b19a682cb7dc7fdf31d31490)
Reviewed-on: https://gerrit.libreoffice.org/1991
Reviewed-by: Michael Stahl mst...@redhat.com
Tested-by: Michael Stahl mst...@redhat.com

diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index 975b834..6ec85ea 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -60,12 +60,12 @@
 #include rtl/strbuf.hxx
 
 #include deque
-#include boost/ptr_container/ptr_vector.hpp
+#include vector
 
 DBG_NAME(SfxDispatcherFlush)
 DBG_NAME(SfxDispatcherFillState)
 
-typedef boost::ptr_vectorSfxRequest SfxRequestPtrArray;
+typedef std::vectorSfxRequest* SfxRequestPtrArray;
 
 DECL_PTRSTACK(SfxShellStack_Impl, SfxShell*, 8, 4 );
 
@@ -110,7 +110,17 @@ struct SfxObjectBars_Impl
 
 struct SfxDispatcher_Impl
 {
-SfxRequestPtrArray   aReqArr;
+//When the dispatched is locked, SfxRequests accumulate in aReqArr for
+//later dispatch when unlocked via Post
+//
+//The pointers are typically deleted in Post, only if we never get around
+//to posting them do we delete the unposted requests.
+SfxRequestPtrArray aReqArr;
+~SfxDispatcher_Impl()
+{
+for (SfxRequestPtrArray::iterator aI = aReqArr.begin(), aEnd = 
aReqArr.end(); aI != aEnd; ++aI)
+delete *aI;
+}
 const SfxSlotServer* pCachedServ1;  // last called message
 const SfxSlotServer* pCachedServ2;  // penultimate called Message
 SfxShellStack_Impl   aStack;// active functionality
@@ -2149,7 +2159,7 @@ void SfxDispatcher::Lock( sal_Bool bLock )
 if ( !bLock )
 {
 for(size_t i = 0; i  pImp-aReqArr.size(); ++i)
-pImp-xPoster-Post(pImp-aReqArr[i]);
+pImp-xPoster-Post(pImp-aReqArr[i]);
 pImp-aReqArr.clear();
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits