summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2010-07-13 14:54:15 +0200
committerKurt Zenker <kz@openoffice.org>2010-07-13 14:54:15 +0200
commitac74bf3e16242e9de3824f03f65df34fdbc95bcd (patch)
treea476a5b70c14f9d0df80aeca9d33b63fe631fbe1
parent255db39b0061de62da296c7a982a3dd466e1f638 (diff)
parent582b6791e275667b93b0ab45bf9a5811758e9e5d (diff)
CWS-TOOLING: integrate CWS sw33bf06_OOO330ooo/OOO330_m1
-rw-r--r--sfx2/source/view/viewimp.hxx4
-rw-r--r--sfx2/source/view/viewprn.cxx11
-rw-r--r--xmloff/source/core/RDFaExportHelper.cxx37
-rw-r--r--xmloff/source/text/XMLTextMarkImportContext.cxx1
4 files changed, 46 insertions, 7 deletions
diff --git a/sfx2/source/view/viewimp.hxx b/sfx2/source/view/viewimp.hxx
index 1f7607ac0b..24dc647130 100644
--- a/sfx2/source/view/viewimp.hxx
+++ b/sfx2/source/view/viewimp.hxx
@@ -75,8 +75,8 @@ struct SfxViewShell_Impl
::svt::AcceleratorExecute* pAccExec;
com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue > aPrintOpts;
::rtl::Reference< SfxClipboardChangeListener > xClipboardListener;
- vcl::PrinterController* pPrinterController;
-
+ ::boost::shared_ptr< vcl::PrinterController > m_pPrinterController;
+
SfxViewShell_Impl();
};
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index b4e6b05f7b..f6854f0f36 100644
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -332,7 +332,9 @@ void SfxPrinterController::jobFinished( com::sun::star::view::PrintableState nSt
mpObjectShell->EnableSetModified( m_bOrigStatus );
if ( mpViewShell )
- mpViewShell->pImp->pPrinterController = 0;
+ {
+ mpViewShell->pImp->m_pPrinterController.reset();
+ }
}
}
@@ -643,8 +645,8 @@ void SfxViewShell::ExecPrint( const uno::Sequence < beans::PropertyValue >& rPro
this,
rProps
) );
- pImp->pPrinterController = pController.get();
-
+ pImp->m_pPrinterController = pController;
+
SfxObjectShell *pObjShell = GetObjectShell();
pController->setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "JobName" ) ),
makeAny( rtl::OUString( pObjShell->GetTitle(0) ) ) );
@@ -661,7 +663,8 @@ void SfxViewShell::ExecPrint( const uno::Sequence < beans::PropertyValue >& rPro
Printer* SfxViewShell::GetActivePrinter() const
{
- return pImp->pPrinterController ? pImp->pPrinterController->getPrinter().get() : 0;
+ return (pImp->m_pPrinterController)
+ ? pImp->m_pPrinterController->getPrinter().get() : 0;
}
void SfxViewShell::ExecPrint_Impl( SfxRequest &rReq )
diff --git a/xmloff/source/core/RDFaExportHelper.cxx b/xmloff/source/core/RDFaExportHelper.cxx
index e88cb6b84b..f0e8b1dac0 100644
--- a/xmloff/source/core/RDFaExportHelper.cxx
+++ b/xmloff/source/core/RDFaExportHelper.cxx
@@ -37,6 +37,8 @@
#include <comphelper/stlunosequence.hxx>
#include <comphelper/stl_types.hxx>
+#include <com/sun/star/uri/XUriReference.hpp>
+#include <com/sun/star/uri/XUriReferenceFactory.hpp>
#include <com/sun/star/rdf/Statement.hpp>
#include <com/sun/star/rdf/URIs.hpp>
#include <com/sun/star/rdf/URI.hpp>
@@ -85,6 +87,39 @@ makeCURIE(SvXMLExport * i_pExport,
return buf.makeStringAndClear();
}
+// #i112473# SvXMLExport::GetRelativeReference() not right for RDF on SaveAs
+// because the URIs in the repository are not rewritten on SaveAs, the
+// URI of the loaded document has to be used, not the URI of the target doc.
+static ::rtl::OUString
+getRelativeReference(SvXMLExport const& rExport, ::rtl::OUString const& rURI)
+{
+ uno::Reference< rdf::XURI > const xModelURI(
+ rExport.GetModel(), uno::UNO_QUERY_THROW );
+ ::rtl::OUString const baseURI( xModelURI->getStringValue() );
+
+ uno::Reference<uno::XComponentContext> const xContext(
+ rExport.GetComponentContext());
+ uno::Reference<lang::XMultiComponentFactory> const xServiceFactory(
+ xContext->getServiceManager(), uno::UNO_SET_THROW);
+ uno::Reference<uri::XUriReferenceFactory> const xUriFactory(
+ xServiceFactory->createInstanceWithContext(
+ ::rtl::OUString::createFromAscii(
+ "com.sun.star.uri.UriReferenceFactory"), xContext),
+ uno::UNO_QUERY_THROW);
+
+ uno::Reference< uri::XUriReference > const xBaseURI(
+ xUriFactory->parse(baseURI), uno::UNO_SET_THROW );
+ uno::Reference< uri::XUriReference > const xAbsoluteURI(
+ xUriFactory->parse(rURI), uno::UNO_SET_THROW );
+ uno::Reference< uri::XUriReference > const xRelativeURI(
+ xUriFactory->makeRelative(xBaseURI, xAbsoluteURI, true, true, false),
+ uno::UNO_SET_THROW );
+ ::rtl::OUString const relativeURI(xRelativeURI->getUriReference());
+
+ return relativeURI;
+}
+
+
////////////////////////////////////////////////////////////////////////////
RDFaExportHelper::RDFaExportHelper(SvXMLExport & i_rExport)
@@ -145,7 +180,7 @@ RDFaExportHelper::AddRDFa(
static const sal_Unicode s_OpenBracket ('[');
static const sal_Unicode s_CloseBracket(']');
const ::rtl::OUString about( xSubjectURI.is()
- ? m_rExport.GetRelativeReference(xSubjectURI->getStringValue())
+ ? getRelativeReference(m_rExport, xSubjectURI->getStringValue())
: ::rtl::OUStringBuffer().append(s_OpenBracket).append(
LookupBlankNode(xSubjectBNode)).append(s_CloseBracket)
.makeStringAndClear()
diff --git a/xmloff/source/text/XMLTextMarkImportContext.cxx b/xmloff/source/text/XMLTextMarkImportContext.cxx
index 803f3c5473..74060049f9 100644
--- a/xmloff/source/text/XMLTextMarkImportContext.cxx
+++ b/xmloff/source/text/XMLTextMarkImportContext.cxx
@@ -116,6 +116,7 @@ XMLTextMarkImportContext::XMLTextMarkImportContext(
const OUString& rLocalName )
: SvXMLImportContext(rImport, nPrefix, rLocalName)
, m_rHelper(rHlp)
+ , m_bHaveAbout(false)
{
}