[Libreoffice-commits] .: 2 commits - sw/source unusedcode.easy
Caolán McNamara
caolan at kemper.freedesktop.org
Mon Sep 12 08:54:24 PDT 2011
sw/source/ui/dochdl/swdtflvr.cxx | 34 ++++++++++++++++++++++++++++++++--
unusedcode.easy | 7 -------
2 files changed, 32 insertions(+), 9 deletions(-)
New commits:
commit 8cc839dc6ac3239bc4a3738cfb6078a8bf92ea72
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Sep 12 16:47:58 2011 +0100
Resolves: fdo#40717 ensure required settings and styles exist in paste doc
diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx
index cfc8205..10c4df3 100755
--- a/sw/source/ui/dochdl/swdtflvr.cxx
+++ b/sw/source/ui/dochdl/swdtflvr.cxx
@@ -365,6 +365,28 @@ void SwTransferable::RemoveDDELinkFormat( const Window& rWin )
CopyToClipboard( (Window*)&rWin );
}
+namespace
+{
+ //Resolves: fdo#40717 surely when we create a clipboard document we should
+ //overwrite the clipboard documents styles and settings with that of the
+ //source, so that we can WYSIWYG paste. If we want that the destinations
+ //styles are used over the source styles, that's a matter of the
+ //destination paste code to handle, not the source paste code.
+ void lclOverWriteDoc(SwWrtShell &rSrcWrtShell, SwDoc &rDest)
+ {
+ const SwDoc &rSrc = *rSrcWrtShell.GetDoc();
+
+ rDest.ReplaceCompatabilityOptions(rSrc);
+ rDest.ReplaceDefaults(rSrc);
+
+ //It would probably make most sense here to only insert the styles used
+ //by the selection, e.g. apply SwDoc::IsUsed on styles ?
+ rDest.ReplaceStyles(rSrc);
+
+ rSrcWrtShell.Copy(&rDest);
+ }
+}
+
sal_Bool SwTransferable::GetData( const DATA_FLAVOR& rFlavor )
{
sal_uInt32 nFormat = SotExchange::GetFormat( rFlavor );
@@ -403,7 +425,7 @@ sal_Bool SwTransferable::GetData( const DATA_FLAVOR& rFlavor )
SwDoc *const pTmpDoc = lcl_GetDoc(*pClpDocFac);
pTmpDoc->LockExpFlds(); // never update fields - leave text as it is
- pWrtShell->Copy( pTmpDoc );
+ lclOverWriteDoc(*pWrtShell, *pTmpDoc);
// in CORE a new one was created (OLE-Objekte copied!)
aDocShellRef = pTmpDoc->GetTmpDocShell();
@@ -700,6 +722,14 @@ sal_Bool SwTransferable::WriteObject( SotStorageStreamRef& xStream,
xWrt->bWriteClipboardDoc = sal_True;
xWrt->bWriteOnlyFirstTable = 0 != (TRNSFR_TABELLE & eBufferType);
xWrt->SetShowProgress( sal_False );
+
+#if defined(DEBUGPASTE)
+ SvFileStream aPasteDebug(rtl::OUString::createFromAscii(
+ "PASTEBUFFER.debug"), STREAM_READWRITE);
+ SwWriter aDbgWrt( aPasteDebug, *pDoc );
+ aDbgWrt.Write( xWrt );
+#endif
+
SwWriter aWrt( *xStream, *pDoc );
if( !IsError( aWrt.Write( xWrt )) )
{
@@ -809,7 +839,7 @@ int SwTransferable::PrepareForCopy( sal_Bool bIsCut )
SwDoc *const pTmpDoc = lcl_GetDoc(*pClpDocFac);
pTmpDoc->LockExpFlds(); // nie die Felder updaten - Text so belassen
- pWrtShell->Copy( pTmpDoc );
+ lclOverWriteDoc(*pWrtShell, *pTmpDoc);
{
IDocumentMarkAccess* const pMarkAccess = pTmpDoc->getIDocumentMarkAccess();
commit ebda86663a2bc0b0d9c4356c07a77accaf3eb18a
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Sep 12 14:45:47 2011 +0100
update list
diff --git a/unusedcode.easy b/unusedcode.easy
index ec4a337..2cc5448 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -926,7 +926,6 @@ SvXMLExport::SvXMLExport(com::sun::star::uno::Reference<com::sun::star::lang::XM
SvXMLExportHelper::AddPercentage(int, rtl::OUStringBuffer&)
SvXMLExportPropertyMapper::exportXML(SvXMLAttributeList&, XMLPropertyState const&, SvXMLUnitConverter const&, SvXMLNamespaceMap const&, unsigned short) const
SvXMLImport::GetErrors()
-SvXMLImport::GetSourceStorage()
SvXMLImport::SetError(int, rtl::OUString const&, rtl::OUString const&, rtl::OUString const&)
SvXMLImport::SetError(int, rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, rtl::OUString const&)
SvXMLImport::SvXMLImport(com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory> const&, com::sun::star::uno::Reference<com::sun::star::frame::XModel> const&)
@@ -1815,7 +1814,6 @@ binfilter::SfxItemModifyArr_Impl::Replace(binfilter::SfxItemModifyImpl const*, u
binfilter::SfxItemModifyArr_Impl::_ForEach(unsigned short, unsigned short, unsigned char (*)(binfilter::SfxItemModifyImpl const&, void*), void*)
binfilter::SfxPtrArr::Insert(unsigned short, void*)
binfilter::SfxPtrArr::Remove(void*)
-binfilter::SfxPtrArr::Replace(void*, void*)
binfilter::SfxUINT32s::Insert(binfilter::SfxUINT32s const*, unsigned short, unsigned short, unsigned short)
binfilter::SfxUINT32s::Insert(unsigned int const&, unsigned short)
binfilter::SfxUINT32s::Remove(unsigned short, unsigned short)
@@ -2126,10 +2124,6 @@ comphelper::OContainerListenerAdapter::unlock()
comphelper::OInteractionRequest::clearContinuations()
comphelper::OPropertyContainerHelper::modifyAttributes(int, int, int)
comphelper::OSelectionChangeListener::disposeAdapter()
-comphelper::OStorageHelper::GetStorageAtPath(com::sun::star::uno::Reference<com::sun::star::embed::XStorage> const&, rtl::OUString const&, unsigned int, comphelper::OStorageHelper::LifecycleProxy&)
-comphelper::OStorageHelper::GetStreamAtPath(com::sun::star::uno::Reference<com::sun::star::embed::XStorage> const&, rtl::OUString const&, unsigned int, comphelper::OStorageHelper::LifecycleProxy&)
-comphelper::OStorageHelper::LifecycleProxy::LifecycleProxy()
-comphelper::OStorageHelper::LifecycleProxy::~LifecycleProxy()
comphelper::OStreamSection::available()
comphelper::OTruncatedTransactedFileStream::OTruncatedTransactedFileStream(rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory> const&)
comphelper::OTruncatedTransactedFileStream::OTruncatedTransactedFileStream(rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::ucb::XSimpleFileAccess> const&, com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory> const&)
@@ -2237,7 +2231,6 @@ dbtools::StatementComposer::getDisposeComposer() const
dbtools::getComposedRowSetStatement(com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> const&, com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory> const&, unsigned char, unsigned char)
dbtools::getConnection(rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory> const&)
dbtools::throwFunctionNotSupportedException(rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&, com::sun::star::uno::Any const&)
-desktop::Lockfile::clean()
dlgprov::DialogProviderImpl::createControlModel()
dp_info::singleton_entries(com::sun::star::uno::Reference<com::sun::star::registry::XRegistryKey> const&)
dp_manager::factory::singleton_entries(com::sun::star::uno::Reference<com::sun::star::registry::XRegistryKey> const&)
More information about the Libreoffice-commits
mailing list