[Libreoffice-commits] core.git: 2 commits - sc/inc sc/source vcl/source
Stephan Bergmann
sbergman at redhat.com
Mon May 6 08:18:08 PDT 2013
sc/inc/conditio.hxx | 24 ++++++++++--------------
sc/source/core/data/conditio.cxx | 28 +++++++++++++++-------------
vcl/source/window/window.cxx | 24 ++++++------------------
3 files changed, 31 insertions(+), 45 deletions(-)
New commits:
commit 3f4a63f1492b7b471ad995029244a6a113e6636d
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Mon May 6 16:25:08 2013 +0200
Revert "abstract type in ptr_container needs this workaround"
d3f063cc86b50ac9adf08eb46dd2caf7975ed43c, by instead restricting the use of the
Boost pointer containers to non-inline code (watch out for implicitly generated
copy ctors and copy assignment ops), thus preventing MSVC from trying to
generate full template instantiations of those containers (similar to
f4227c822c7f5a4e1e1b3b4e096cb63cf710a3f1 "Blind fix for MSVC, take two").
Turns out the ScConditionalFormat copy ctor was unused anyway (but the
ScConditionalFormatList copy ctor isn't, so only prevent generation of an
implicit copy assignment op there).
Change-Id: I23303a98df7024dbce95638ac13097b71a9c5c04
diff --git a/sc/inc/conditio.hxx b/sc/inc/conditio.hxx
index bcf72c9..9e7e14d 100644
--- a/sc/inc/conditio.hxx
+++ b/sc/inc/conditio.hxx
@@ -31,6 +31,7 @@
#include <map>
+#include <boost/noncopyable.hpp>
#include <boost/ptr_container/ptr_set.hpp>
#include <boost/ptr_container/ptr_vector.hpp>
#include <boost/scoped_ptr.hpp>
@@ -367,7 +368,7 @@ private:
// complete conditional formatting
//
-class SC_DLLPUBLIC ScConditionalFormat
+class SC_DLLPUBLIC ScConditionalFormat: private boost::noncopyable
{
ScDocument* pDoc;
sal_uInt32 nKey; // Index in attributes
@@ -378,7 +379,6 @@ class SC_DLLPUBLIC ScConditionalFormat
public:
ScConditionalFormat(sal_uInt32 nNewKey, ScDocument* pDocument);
- ScConditionalFormat(const ScConditionalFormat& r);
~ScConditionalFormat();
// true copy of formulas (for Ref-Undo / between documents)
@@ -390,8 +390,8 @@ public:
// don't use the same name as for the const version
ScRangeList& GetRangeList() { return maRanges; }
- bool IsEmpty() const { return maEntries.empty(); }
- size_t size() const { return maEntries.size(); }
+ bool IsEmpty() const;
+ size_t size() const;
void CompileAll();
void CompileXML();
@@ -434,16 +434,19 @@ public:
class SC_DLLPUBLIC ScConditionalFormatList
{
private:
- boost::ptr_set<ScConditionalFormat> maConditionalFormats;
typedef boost::ptr_set<ScConditionalFormat> ConditionalFormatContainer;
+ ConditionalFormatContainer maConditionalFormats;
+
+ void operator =(ScConditionalFormatList const &) SAL_DELETED_FUNCTION;
+
public:
ScConditionalFormatList() {}
ScConditionalFormatList(const ScConditionalFormatList& rList);
ScConditionalFormatList(ScDocument* pDoc, const ScConditionalFormatList& rList);
~ScConditionalFormatList() {}
- void InsertNew( ScConditionalFormat* pNew )
- { maConditionalFormats.insert(pNew); }
+ void InsertNew( ScConditionalFormat* pNew );
+
/**
* Checks that all cond formats have a non empty range.
* Deletes empty cond formats.
@@ -481,13 +484,6 @@ public:
void endRendering();
};
-// see http://www.boost.org/doc/libs/1_49_0/libs/ptr_container/doc/tutorial.html#cloneability
-//for MSVC we need:
-inline ScFormatEntry* new_clone( const ScFormatEntry& rFormat )
-{
- return rFormat.Clone();
-}
-
#endif
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index f898cfe..c091cd5 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -1829,19 +1829,6 @@ ScConditionalFormat::ScConditionalFormat(sal_uInt32 nNewKey, ScDocument* pDocume
{
}
-ScConditionalFormat::ScConditionalFormat(const ScConditionalFormat& r) :
- pDoc( r.pDoc ),
- nKey( r.nKey ),
- maRanges( r.maRanges )
-{
- for (CondFormatContainer::const_iterator itr = r.maEntries.begin(); itr != r.maEntries.end(); ++itr)
- {
- ScFormatEntry* pNewEntry = itr->Clone(r.pDoc);
- maEntries.push_back( pNewEntry );
- pNewEntry->SetParent(this);
- }
-}
-
ScConditionalFormat* ScConditionalFormat::Clone(ScDocument* pNewDoc) const
{
// echte Kopie der Formeln (fuer Ref-Undo / zwischen Dokumenten)
@@ -1890,6 +1877,16 @@ void ScConditionalFormat::AddEntry( ScFormatEntry* pNew )
pNew->SetParent(this);
}
+bool ScConditionalFormat::IsEmpty() const
+{
+ return maEntries.empty();
+}
+
+size_t ScConditionalFormat::size() const
+{
+ return maEntries.size();
+}
+
ScConditionalFormat::~ScConditionalFormat()
{
}
@@ -2106,6 +2103,11 @@ ScConditionalFormatList::ScConditionalFormatList(ScDocument* pDoc, const ScCondi
InsertNew( itr->Clone(pDoc) );
}
+void ScConditionalFormatList::InsertNew( ScConditionalFormat* pNew )
+{
+ maConditionalFormats.insert(pNew);
+}
+
bool ScConditionalFormatList::operator==( const ScConditionalFormatList& r ) const
{
// fuer Ref-Undo - interne Variablen werden nicht verglichen
commit fb24a49d76edfe3cc7c9aeb7e9c293bee8a3d371
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Mon May 6 16:18:28 2013 +0200
Drop unused SystemClipboardExt and GenericClipboardExt services
...uses of which had been introduced with
2fab32e831fc02e7efd4069aa0dfc7779d97a9cf "mtclip01: #i112022# Allow extended
clipboard creation" but which did not introduce any implementations of those
services, so this might have been a hook for StarOffice-only functionality.
Change-Id: I4d3c977547147aaca78b6079d1df8fbf6b196650
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 279caf8..fc692d2 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -8408,21 +8408,14 @@ uno::Reference< XClipboard > Window::GetClipboard()
{
try
{
- uno::Reference< XMultiServiceFactory > xFactory( comphelper::getProcessServiceFactory() );
uno::Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() );
-
- mpWindowImpl->mpFrameData->mxClipboard = uno::Reference< XClipboard >( xFactory->createInstance( OUString("com.sun.star.datatransfer.clipboard.SystemClipboardExt") ), UNO_QUERY );
-
- if( !mpWindowImpl->mpFrameData->mxClipboard.is() )
- {
- Reference<XSystemClipboard> xSystemClipboard;
+ Reference<XSystemClipboard> xSystemClipboard;
#if defined(UNX) && !defined(MACOSX) // unix clipboard needs to be initialized
- xSystemClipboard = SystemClipboard::createUnix( xContext, Application::GetDisplayConnection(), "CLIPBOARD", vcl::createBmpConverter() );
+ xSystemClipboard = SystemClipboard::createUnix( xContext, Application::GetDisplayConnection(), "CLIPBOARD", vcl::createBmpConverter() );
#else
- xSystemClipboard = SystemClipboard::createDefault(xContext);
+ xSystemClipboard = SystemClipboard::createDefault(xContext);
#endif
- mpWindowImpl->mpFrameData->mxClipboard.set( xSystemClipboard, UNO_QUERY );
- }
+ mpWindowImpl->mpFrameData->mxClipboard.set( xSystemClipboard, UNO_QUERY );
}
// createInstance can throw any exception
catch (const Exception&)
@@ -8456,13 +8449,8 @@ uno::Reference< XClipboard > Window::GetPrimarySelection()
Reference<XSystemClipboard> xSystemClipboard = SystemClipboard::createUnix( xContext, Application::GetDisplayConnection(), "PRIMARY", vcl::createBmpConverter() );
mpWindowImpl->mpFrameData->mxSelection = uno::Reference< XClipboard >( xSystemClipboard, UNO_QUERY );
# else
- static uno::Reference< XClipboard > s_xSelection;
-
- if ( !s_xSelection.is() )
- s_xSelection.set( xContext->getServiceManager()->createInstanceWithContext( "com.sun.star.datatransfer.clipboard.GenericClipboardExt", xContext ), UNO_QUERY );
-
- if ( !s_xSelection.is() )
- s_xSelection.set( xContext->getServiceManager()->createInstanceWithContext( "com.sun.star.datatransfer.clipboard.GenericClipboard", xContext ), UNO_QUERY );
+ static uno::Reference< XClipboard > s_xSelection(
+ xContext->getServiceManager()->createInstanceWithContext( "com.sun.star.datatransfer.clipboard.GenericClipboard", xContext ), UNO_QUERY );
mpWindowImpl->mpFrameData->mxSelection = s_xSelection;
# endif
More information about the Libreoffice-commits
mailing list