Kaydet (Commit) 2f7b92c5 authored tarafından Oliver-Rainer Wittmann's avatar Oliver-Rainer Wittmann Kaydeden (comit) Caolán McNamara

Resolves: #i124914# reset certain language dependent pool defaults...

before importing a document via <SfxObjectShell::ImportFrom(..)> (used for
OOXML *.docx import)

(cherry picked from commit 920bf1164fe0c3d232dc0f7d476eec1660f4690e)

Conflicts:
	sfx2/inc/sfx2/objsh.hxx
	sw/inc/docsh.hxx
	sw/source/ui/app/docsh.cxx
	sw/source/ui/app/docsh2.cxx
	sw/source/ui/app/docshini.cxx
	sw/source/ui/app/docst.cxx
	sw/source/ui/app/docstyle.cxx

Change-Id: Id32bd6a8ef081dd4af4d832aa42317de7f64184f
üst 587f178b
......@@ -177,6 +177,15 @@ private:
// sal_False := new object
bool bIsInGenerateThumbnail; //optimize thumbnail generate and store procedure to improve odt saving performance, i120030
protected:
// methods called in implementation of <ImportFrom(..)>
virtual void BeforeLoading(SfxMedium&,
const OUString&) {}
virtual void AfterLoading(SfxMedium&,
const OUString&) {}
private:
SAL_DLLPRIVATE void UpdateTime_Impl(const ::com::sun::star::uno::Reference<
::com::sun::star::document::XDocumentProperties> & i_xDocProps);
......
......@@ -2177,6 +2177,8 @@ bool SfxObjectShell::ImportFrom(SfxMedium& rMedium,
{
OUString aFilterName( rMedium.GetFilter()->GetFilterName() );
BeforeLoading(rMedium, aFilterName);
uno::Reference< lang::XMultiServiceFactory > xMan = ::comphelper::getProcessServiceFactory();
uno::Reference < lang::XMultiServiceFactory > xFilterFact (
xMan->createInstance( "com.sun.star.document.FilterFactory" ), uno::UNO_QUERY );
......@@ -2284,6 +2286,8 @@ bool SfxObjectShell::ImportFrom(SfxMedium& rMedium,
}
}
}
AfterLoading(rMedium, aFilterName);
return bRtn;
}
catch (const packages::zip::ZipIOException&)
......
......@@ -54,24 +54,24 @@ class IDocumentChartDataProviderAccess;
class SW_DLLPUBLIC SwDocShell: public SfxObjectShell, public SfxListener
{
SwDoc* pDoc; ///< Document.
SwDoc* mpDoc; ///< Document.
rtl::Reference< SfxStyleSheetBasePool > mxBasePool; ///< Passing through for formats.
FontList* pFontList; ///< Current Fontlist.
FontList* mpFontList; ///< Current Fontlist.
bool mbInUpdateFontList; ///< prevent nested calls of UpdateFontList
/** For "historical reasons" nothing can be done without the WrtShell.
Back-pointer on View (again "for historical reasons").
Back-pointer is valid until in Activate a new one is set
or until it is deleted in the View's Dtor. */
SwView* pView;
SwWrtShell* pWrtShell;
SwView* mpView;
SwWrtShell* mpWrtShell;
Timer aFinishedTimer; /**< Timer for checking graphics-links.
If all are present, the doc is loaded completely. */
comphelper::EmbeddedObjectContainer* pOLEChildList;
sal_Int16 nUpdateDocMode; ///< contains the com::sun::star::document::UpdateDocMode
bool bInUpdateFontList; ///< prevent nested calls of UpdateFontList
comphelper::EmbeddedObjectContainer* mpOLEChildList;
sal_Int16 mnUpdateDocMode; ///< contains the com::sun::star::document::UpdateDocMode
bool bIsATemplate; ///< prevent nested calls of UpdateFontList
/// Methods for access to doc.
......@@ -143,6 +143,12 @@ protected:
/// override to update text fields
virtual void DoFlushDocInfo() SAL_OVERRIDE;
// override <SfxObjectShell>'s method which is called in
// <SfxObjectShell::ImportFrom(..)>.
// <SfxObjectShell::ImportFrom(..)> is used by current import of Microsoft
// Word documents in OOXML file format.
virtual void BeforeLoading(SfxMedium&, const ::rtl::OUString&) SAL_OVERRIDE;
public:
using SotObject::GetInterface;
......@@ -190,8 +196,8 @@ public:
void StateStyleSheet(SfxItemSet&, SwWrtShell* pSh = 0 );
/// returns Doc. But be careful!
inline SwDoc* GetDoc() { return pDoc; }
inline const SwDoc* GetDoc() const { return pDoc; }
inline SwDoc* GetDoc() { return mpDoc; }
inline const SwDoc* GetDoc() const { return mpDoc; }
IDocumentDeviceAccess* getIDocumentDeviceAccess();
const IDocumentSettingAccess* getIDocumentSettingAccess() const;
IDocumentChartDataProviderAccess* getIDocumentChartDataProviderAccess();
......@@ -207,12 +213,12 @@ public:
/// Set View for actions via Shell.
void SetView(SwView* pVw);
const SwView *GetView() const { return pView; }
SwView *GetView() { return pView; }
const SwView *GetView() const { return mpView; }
SwView *GetView() { return mpView; }
/// Accress to the SwWrtShell belonging to SwView.
SwWrtShell *GetWrtShell() { return pWrtShell; }
const SwWrtShell *GetWrtShell() const { return pWrtShell; }
SwWrtShell *GetWrtShell() { return mpWrtShell; }
const SwWrtShell *GetWrtShell() const { return mpWrtShell; }
/// For Core - it knows the DocShell but not the WrtShell!
SwFEShell *GetFEShell();
......@@ -263,7 +269,7 @@ public:
/// Re-read Doc from Html-source.
void ReloadFromHtml( const OUString& rStreamName, SwSrcView* pSrcView );
sal_Int16 GetUpdateDocMode() const {return nUpdateDocMode;}
sal_Int16 GetUpdateDocMode() const {return mnUpdateDocMode;}
void ToggleBrowserMode(bool bOn, SwView* pView);
......
This diff is collapsed.
This diff is collapsed.
......@@ -35,7 +35,7 @@ using namespace ::com::sun::star;
// Load Document
void SwDocShell::InitDraw()
{
SdrModel *pDrDoc = pDoc->getIDocumentDrawModelAccess().GetDrawModel();
SdrModel *pDrDoc = mpDoc->getIDocumentDrawModelAccess().GetDrawModel();
if( pDrDoc )
{
// create Lists and Tables DocShell's ItemSet
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment