[Libreoffice-commits] .: 2 commits - sfx2/inc sfx2/source

2012-01-20 Thread August Sodora
 sfx2/inc/sfx2/dispatch.hxx   |9 +-
 sfx2/inc/sfx2/msgpool.hxx|1 
 sfx2/source/control/dispatch.cxx |  122 ++-
 3 files changed, 63 insertions(+), 69 deletions(-)

New commits:
commit 6dc58d6c28b20d8dfb12673c3e733417e0644090
Author: August Sodora 
Date:   Fri Jan 20 14:44:41 2012 -0500

Fix build

diff --git a/sfx2/inc/sfx2/msgpool.hxx b/sfx2/inc/sfx2/msgpool.hxx
index a110b58..bd65772 100644
--- a/sfx2/inc/sfx2/msgpool.hxx
+++ b/sfx2/inc/sfx2/msgpool.hxx
@@ -37,6 +37,7 @@
 #include 
 
 #include 
+#include 
 
 class SfxInterface;
 class SfxSlot;
commit 56208a1b367b25eea8bd7df5507cf4fa1fe8fb1d
Author: August Sodora 
Date:   Fri Jan 20 14:37:00 2012 -0500

DECL_PTRSTACK->std::stack

diff --git a/sfx2/inc/sfx2/dispatch.hxx b/sfx2/inc/sfx2/dispatch.hxx
index de65742..0867aa5 100644
--- a/sfx2/inc/sfx2/dispatch.hxx
+++ b/sfx2/inc/sfx2/dispatch.hxx
@@ -37,10 +37,11 @@
 #include 
 #include 
 
+#include 
+
 class SfxSlotServer;
 class SfxShell;
 class SfxRequest;
-class SfxShellStack_Impl;
 class SfxHintPoster;
 class SfxViewFrame;
 class SfxBindings;
@@ -64,20 +65,18 @@ namespace com
 }
 }
 
-//=
-
 #define SFX_SHELL_POP_UNTIL 4
 #define SFX_SHELL_POP_DELETE2
 #define SFX_SHELL_PUSH  1
 
-//=
-
 typedef SfxPoolItem* SfxPoolItemPtr;
 SV_DECL_PTRARR_DEL( SfxItemPtrArray, SfxPoolItemPtr, 4, 4 )
 
 // fuer  shell.cxx
 typedef SfxItemPtrArray SfxItemArray_Impl;
 
+typedef std::deque SfxShellStack_Impl;
+
 class SFX2_DLLPUBLIC SfxDispatcher
 {
 SfxDispatcher_Impl* pImp;
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index 7b26105..88dfc70 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -75,19 +75,14 @@
 
 namespace css = ::com::sun::star;
 
-//==
 DBG_NAME(SfxDispatcherFlush)
 DBG_NAME(SfxDispatcherFillState)
 
-//==
 typedef SfxRequest* SfxRequestPtr;
 SV_IMPL_PTRARR( SfxItemPtrArray, SfxPoolItemPtr );
 SV_DECL_PTRARR_DEL( SfxRequestPtrArray, SfxRequestPtr, 4, 4 )
 SV_IMPL_PTRARR( SfxRequestPtrArray, SfxRequestPtr );
 
-DECL_PTRSTACK(SfxShellStack_Impl, SfxShell*, 8, 4 );
-//==
-
 struct SfxToDo_Impl
 {
 SfxShell*  pCluster;
@@ -575,14 +570,15 @@ sal_Bool SfxDispatcher::CheckVirtualStack( const 
SfxShell& rShell, sal_Bool bDee
 for(std::deque::reverse_iterator i = 
pImp->aToDoStack.rbegin(); i != pImp->aToDoStack.rend(); ++i)
 {
 if(i->bPush)
-aStack.Push(i->pCluster);
+aStack.push_front(i->pCluster);
 else
 {
 SfxShell* pPopped(NULL);
 do
 {
-DBG_ASSERT( aStack.Count(), "popping from empty stack" );
-pPopped = aStack.Pop();
+DBG_ASSERT( aStack.size(), "popping from empty stack" );
+pPopped = aStack.front();
+aStack.pop_front();
 }
 while(i->bUntil && pPopped != i->pCluster);
 DBG_ASSERT(pPopped == i->pCluster, "popping unpushed 
SfxInterface");
@@ -591,9 +587,12 @@ sal_Bool SfxDispatcher::CheckVirtualStack( const SfxShell& 
rShell, sal_Bool bDee
 
 sal_Bool bReturn;
 if ( bDeep )
-bReturn = aStack.Contains(&rShell);
+{
+SfxShellStack_Impl::const_iterator i = std::find(aStack.begin(), 
aStack.end(), &rShell);
+bReturn = (i != aStack.end());
+}
 else
-bReturn = aStack.Top() == &rShell;
+bReturn = aStack.front() == &rShell;
 return bReturn;
 }
 
@@ -619,15 +618,15 @@ sal_uInt16 SfxDispatcher::GetShellLevel( const SfxShell& 
rShell )
 SFX_STACK(SfxDispatcher::GetShellLevel);
 Flush();
 
-for ( sal_uInt16 n = 0; n < pImp->aStack.Count(); ++n )
-if ( pImp->aStack.Top( n ) == &rShell )
+for(size_t n = 0; n < pImp->aStack.size(); ++n)
+if ( pImp->aStack[n] == &rShell )
 return n;
 if ( pImp->pParent )
 {
 sal_uInt16 nRet = pImp->pParent->GetShellLevel(rShell);
 if ( nRet == USHRT_MAX )
 return nRet;
-return  nRet + pImp->aStack.Count();
+return  nRet + pImp->aStack.size();
 }
 
 return USHRT_MAX;
@@ -647,9 +646,9 @@ SfxShell *SfxDispatcher::GetShell(sal_uInt16 nIdx) const
 */
 
 {
-sal_uInt16 nShellCount = pImp->aStack.Count();
+sal_uInt16 nShellCount = pImp->aStack.size();
 if ( nIdx < nShellCount )
-return pImp->aStack.Top(nIdx);
+return pImp->aStack[nIdx];
 else if ( pImp->pParent )
 return pImp->pParent->GetShell( nIdx - nShellCount );
 return 0;
@@ -740,8 +739,8 @@ void SfxDispatcher::DoActivate_Impl( sa

[Libreoffice-commits] .: 2 commits - sfx2/inc sfx2/source

2012-01-10 Thread Stephan Bergmann
 sfx2/inc/sfx2/doctempl.hxx   |3 
 sfx2/source/doc/doctdlg.cxx  |5 
 sfx2/source/doc/doctempl.cxx |  200 ++-
 sfx2/source/doc/doctemplates.cxx |3 
 sfx2/source/doc/docvor.cxx   |8 -
 sfx2/source/doc/new.cxx  |5 
 6 files changed, 77 insertions(+), 147 deletions(-)

New commits:
commit d506bc43f6982b33e42b3449cad059075f8faca1
Author: Stephan Bergmann 
Date:   Tue Jan 10 16:38:24 2012 +0100

Hide bogus "Untitled already exists" errors...

...when adding multiple new template regions in a row in
SfxOrganizeDlg_Impl.

diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index dcaaeca..fce978c 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -873,7 +873,8 @@ sal_Bool 
SfxDocTplService_Impl::CreateNewUniqueFolderWithPrefix( const ::rtl::OU
 INetURLObject aDirPath( aPath );
 
 Content aParent;
-   if ( Content::create( aDirPath.GetMainURL( INetURLObject::NO_DECODE ), 
maCmdEnv, aParent ) )
+uno::Reference< XCommandEnvironment > aQuietEnv;
+   if ( Content::create( aDirPath.GetMainURL( INetURLObject::NO_DECODE ), 
aQuietEnv, aParent ) )
{
 for ( sal_Int32 nInd = 0; nInd < 32000; nInd++ )
 {
commit 4a8e458b45dd063a82825e252366f678aec23921
Author: Stephan Bergmann 
Date:   Tue Jan 10 16:04:58 2012 +0100

fdo#43532 Partial revert of "...template names appear... correct word order"

Sorting the sfx2-based list boxes does not work as SfxDocumentTemplates 
uses a
different collating order (plain Unicode code points) than the list boxes, 
so
that e.g. "en-US" comes last in SfxDocumentTemplates but not in the list 
boxes.
Even with that fixed, insertions into SfxOrganizeDlg_Impl would still not 
work
right.

This reverts the sfx2 parts of commits 
50b7733fa41879a62d35cab64da59b109e1a8502
and df59068902b294b7b344af0c20da196cc64aaced.

diff --git a/sfx2/inc/sfx2/doctempl.hxx b/sfx2/inc/sfx2/doctempl.hxx
index b60ac95..df1d9f0 100644
--- a/sfx2/inc/sfx2/doctempl.hxx
+++ b/sfx2/inc/sfx2/doctempl.hxx
@@ -93,9 +93,6 @@ public:
 int nCount,
 const ::rtl::OUString& rString);
 
-voidEnableRegionSorting(bool isRegionSortingEnabled = 
true);
-voidEnableTemplateSorting(bool isTemplateSortingEnabled = 
true);
-
 sal_BoolCopy(sal_uInt16 nTargetRegion,
  sal_uInt16 nTargetIdx,
  sal_uInt16 nSourceRegion,
diff --git a/sfx2/source/doc/doctdlg.cxx b/sfx2/source/doc/doctdlg.cxx
index c0f83a0..2b61618 100644
--- a/sfx2/source/doc/doctdlg.cxx
+++ b/sfx2/source/doc/doctdlg.cxx
@@ -73,8 +73,6 @@ SfxDocumentTemplateDlg::SfxDocumentTemplateDlg( Window * 
pParent, SfxDocumentTem
 aNameEd.SetModifyHdl(LINK(this, SfxDocumentTemplateDlg, NameModify));
 aOkBt.SetClickHdl(LINK(this, SfxDocumentTemplateDlg, OkHdl));
 aEditBt.SetClickHdl(LINK(this, SfxDocumentTemplateDlg, EditHdl));
-aRegionLb.SetStyle(aRegionLb.GetStyle() | WB_SORT);
-aTemplateLb.SetStyle(aTemplateLb.GetStyle() | WB_SORT);
 Init();
 }
 
@@ -109,9 +107,6 @@ void SfxDocumentTemplateDlg::Init()
 if(!pTemplates->IsConstructed())
 pTemplates->Construct();
 
-pTemplates->EnableRegionSorting();
-pTemplates->EnableTemplateSorting();
-
 const sal_uInt16 nCount = pTemplates->GetRegionCount();
 for(sal_uInt16 i = 0; i < nCount; ++i)
 aRegionLb.InsertEntry(pTemplates->GetFullRegionName(i));
diff --git a/sfx2/source/doc/doctempl.cxx b/sfx2/source/doc/doctempl.cxx
index 8a194f8..d3878d9 100644
--- a/sfx2/source/doc/doctempl.cxx
+++ b/sfx2/source/doc/doctempl.cxx
@@ -36,6 +36,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -100,7 +101,6 @@ using namespace ::ucbhelper;
 #include 
 
 #include 
-#include 
 using ::std::vector;
 using ::std::advance;
 
@@ -169,13 +169,6 @@ public:
 sal_BoolDeleteObjectShell();
 };
 
-class TemplateEntryCompare
-{
-public:
-bool operator()( DocTempl_EntryData_Impl* pA, DocTempl_EntryData_Impl* pB 
) const
-{ return 0 > pA->Compare( pB->GetTitle() ); }
-};
-
 }
 
 using namespace ::DocTempl;
@@ -189,7 +182,6 @@ class RegionData_Impl
 OUStringmaTitle;
 OUStringmaOwnURL;
 OUStringmaTargetURL;
-boolmbSortingEnabled;
 
 private:
 size_t  GetEntryPos( const OUString& rTitle,
@@ -220,20 +212,11 @@ public:
   size_t *pPos = NULL );
 voidDeleteEntry( size_t nIndex );
 
-voidEnableSorting( bool isSortingEnabled = true );
-
 int Compare( const OUString& rTitle ) const
 { return maTitle.compareTo( rTitle ); }
 int  

[Libreoffice-commits] .: 2 commits - sfx2/inc sfx2/source

2011-11-14 Thread Takeshi Abe
 sfx2/inc/sfx2/docfilt.hxx|4 ++--
 sfx2/inc/sfx2/fcontnr.hxx|2 +-
 sfx2/source/appl/appinit.cxx |7 ---
 sfx2/source/appl/appmain.cxx |   19 ---
 sfx2/source/appl/sfxpicklist.cxx |   36 ++--
 sfx2/source/bastyp/fltfnc.cxx|4 ++--
 sfx2/source/doc/objstor.cxx  |2 +-
 sfx2/source/inc/sfxpicklist.hxx  |   13 ++---
 8 files changed, 30 insertions(+), 57 deletions(-)

New commits:
commit 12df49396e6bcb07bafc95255a8526caac96e60a
Author: Takeshi Abe 
Date:   Mon Nov 14 18:32:07 2011 +0900

replaced String in SfxPickList with rtl::OUString

diff --git a/sfx2/inc/sfx2/docfilt.hxx b/sfx2/inc/sfx2/docfilt.hxx
index a951239..1da1dea 100644
--- a/sfx2/inc/sfx2/docfilt.hxx
+++ b/sfx2/inc/sfx2/docfilt.hxx
@@ -57,7 +57,7 @@ friend class SfxFilterContainer;
 SfxFilterFlags  nFormatType;
 sal_uInt16  nDocIcon;
 String  aServiceName;
-String  aMimeType;
+::rtl::OUString aMimeType;
 String  aFilterName;
 String  aPattern;
 sal_uIntPtr   nVersion;
@@ -85,7 +85,7 @@ public:
 bool IsInternal() const { return nFormatType & SFX_FILTER_INTERNAL; }
 SfxFilterFlags  GetFilterFlags() const  { return nFormatType; }
 const String&   GetFilterName() const { return aFilterName; }
-const String&   GetMimeType() const { return aMimeType; }
+const ::rtl::OUString& GetMimeType() const { return aMimeType; }
 const String&   GetName() const { return  aFilterName; }
 const WildCard& GetWildcard() const { return aWildCard; }
 const String&   GetRealTypeName() const { return aTypeName; }
diff --git a/sfx2/inc/sfx2/fcontnr.hxx b/sfx2/inc/sfx2/fcontnr.hxx
index a6187a6..f6c1d01 100644
--- a/sfx2/inc/sfx2/fcontnr.hxx
+++ b/sfx2/inc/sfx2/fcontnr.hxx
@@ -140,7 +140,7 @@ public:
 sal_uInt32   GuessFilterControlDefaultUI( SfxMedium& rMedium, 
const SfxFilter **, SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags 
nDont = SFX_FILTER_NOTINSTALLED, sal_Bool bDefUI = sal_True ) const;
 sal_uInt32   DetectFilter( SfxMedium& rMedium, const SfxFilter 
**, sal_Bool bPlugIn, sal_Bool bAPI = sal_False ) const;
 
-const SfxFilter*GetFilter4Mime( const String& rMime, SfxFilterFlags 
nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED) 
const;
+const SfxFilter*GetFilter4Mime( const ::rtl::OUString& rMime, 
SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = 
SFX_FILTER_NOTINSTALLED) const;
 const SfxFilter*GetFilter4ClipBoardId( sal_uInt32 nId, SfxFilterFlags 
nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) 
const;
 const SfxFilter*GetFilter4EA( const String& rEA, SfxFilterFlags nMust 
= SFX_FILTER_IMPORT, SfxFilterFlags nDont = SFX_FILTER_NOTINSTALLED ) const;
 const SfxFilter*GetFilter4Extension( const String& rExt, 
SfxFilterFlags nMust = SFX_FILTER_IMPORT, SfxFilterFlags nDont = 
SFX_FILTER_NOTINSTALLED ) const;
diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx
index c3332d9..d80a80c 100644
--- a/sfx2/source/appl/sfxpicklist.cxx
+++ b/sfx2/source/appl/sfxpicklist.cxx
@@ -84,30 +84,30 @@ class StringLength : public ::cppu::WeakImplHelper1< 
XStringWidth >
 }
 };
 
-void SfxPickList::CreatePicklistMenuTitle( Menu* pMenu, sal_uInt16 nItemId, 
const String& aURLString, sal_uInt32 nNo )
+void SfxPickList::CreatePicklistMenuTitle( Menu* pMenu, sal_uInt16 nItemId, 
const ::rtl::OUString& aURLString, sal_uInt32 nNo )
 {
-String aPickEntry;
+::rtl::OUStringBuffer aPickEntry;
 
 if ( nNo < 9 )
 {
-aPickEntry += '~';
-aPickEntry += String::CreateFromInt32( nNo + 1 );
+aPickEntry.append('~');
+aPickEntry.append(::rtl::OUString::valueOf(static_cast(nNo 
+ 1)));
 }
 else if ( nNo == 9 )
-aPickEntry += DEFINE_CONST_UNICODE("1~0");
+aPickEntry.appendAscii("1~0");
 else
-aPickEntry += String::CreateFromInt32( nNo + 1 );
-aPickEntry += DEFINE_CONST_UNICODE(": ");
+aPickEntry.append(::rtl::OUString::valueOf(static_cast(nNo 
+ 1)));
+aPickEntry.appendAscii(": ");
 
 INetURLObject   aURL( aURLString );
 rtl::OUString   aTipHelpText;
-rtl::OUString   aAccessibleName( aPickEntry );
+rtl::OUString   aAccessibleName = aPickEntry.toString();
 
 if ( aURL.GetProtocol() == INET_PROT_FILE )
 {
 // Do handle file URL differently => convert it to a system
 // path and abbreviate it with a special function:
-String aFileSystemPath( aURL.getFSysPath( INetURLObject::FSYS_DETECT ) 
);
+::rtl::OUString aFileSystemPath( aURL.getFSysPath( 
INetURLObject::FSYS_DETECT ) );
 
 ::rtl::OUString aSystemPath( aFileSystemPath );
 ::rtl::OUString aCompactedSystemPath;
@@ -116,28 +116,28 @@ void SfxPickList::CreatePicklistMenuTitle( Menu* pMen