diff options
-rw-r--r-- | sw/inc/shellio.hxx | 4 | ||||
-rw-r--r-- | sw/source/filter/basflt/shellio.cxx | 10 | ||||
-rw-r--r-- | sw/source/filter/html/swhtml.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/html/wrthtml.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/inc/fltini.hxx | 2 |
5 files changed, 14 insertions, 10 deletions
diff --git a/sw/inc/shellio.hxx b/sw/inc/shellio.hxx index e0bdf94f2c65..409a0e3a4f33 100644 --- a/sw/inc/shellio.hxx +++ b/sw/inc/shellio.hxx @@ -220,7 +220,7 @@ protected: sal_Bool bHasAskTemplateName : 1; sal_Bool bIgnoreHTMLComments : 1; - virtual String GetTemplateName() const; + virtual String GetTemplateName(SwDoc& rDoc) const; public: Reader(); @@ -239,7 +239,7 @@ public: static void ResetFrmFmts( SwDoc& rDoc ); // Load filter template, set it and release it again. - SwDoc* GetTemplateDoc(); + SwDoc* GetTemplateDoc(SwDoc& rDoc); sal_Bool SetTemplate( SwDoc& rDoc ); void ClearTemplate(); void SetTemplateName( const String& rDir ); diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx index fc9ec6b3b8fc..c4f5d2483cd6 100644 --- a/sw/source/filter/basflt/shellio.cxx +++ b/sw/source/filter/basflt/shellio.cxx @@ -450,17 +450,17 @@ Reader::~Reader() delete pTemplate; } -String Reader::GetTemplateName() const +String Reader::GetTemplateName(SwDoc& /*rDoc*/) const { return aEmptyStr; } // Die Filter-Vorlage laden, setzen und wieder freigeben -SwDoc* Reader::GetTemplateDoc() +SwDoc* Reader::GetTemplateDoc(SwDoc& rDoc) { if( !bHasAskTemplateName ) { - SetTemplateName( GetTemplateName() ); + SetTemplateName( GetTemplateName(rDoc) ); bHasAskTemplateName = sal_True; } @@ -543,7 +543,7 @@ sal_Bool Reader::SetTemplate( SwDoc& rDoc ) { sal_Bool bRet = sal_False; - GetTemplateDoc(); + GetTemplateDoc(rDoc); if( pTemplate ) { rDoc.RemoveAllFmtLanguageDependencies(); @@ -955,7 +955,7 @@ sal_uLong SwWriter::Write( WriterRef& rxWriter, const String* pRealFileName ) sal_Bool SetHTMLTemplate( SwDoc & rDoc ) { // Vorlagennamen von den Sfx-HTML-Filter besorgen!!! - if( !ReadHTML->GetTemplateDoc() ) + if( !ReadHTML->GetTemplateDoc(rDoc) ) ReadHTML->MakeHTMLDummyTemplateDoc(); sal_Bool bRet = ReadHTML->SetTemplate( rDoc ); diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index fcee5a4cd969..f7079d99f018 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -146,8 +146,12 @@ HTMLReader::HTMLReader() bTmplBrowseMode = sal_True; } -String HTMLReader::GetTemplateName() const +String HTMLReader::GetTemplateName(SwDoc& rDoc) const { + if (!rDoc.get(IDocumentSettingAccess::HTML_MODE)) + // HTML import into Writer, avoid loading the Writer/Web template. + return String(); + String sTemplate(rtl::OUString("internal")); sTemplate += INET_PATH_TOKEN; sTemplate.AppendAscii( TOOLS_CONSTASCII_STRINGPARAM("html") ); diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx index 470f2ca2d27d..62b93327f388 100644 --- a/sw/source/filter/html/wrthtml.cxx +++ b/sw/source/filter/html/wrthtml.cxx @@ -216,7 +216,7 @@ sal_uLong SwHTMLWriter::WriteStream() sal_uInt16 nOldTxtFmtCollCnt = 0, nOldCharFmtCnt = 0; OSL_ENSURE( !pTemplate, "Wo kommt denn die HTML-Vorlage hier her?" ); - pTemplate = ((HTMLReader*)ReadHTML)->GetTemplateDoc(); + pTemplate = ((HTMLReader*)ReadHTML)->GetTemplateDoc(*pDoc); if( pTemplate ) { pTemplate->acquire(); diff --git a/sw/source/filter/inc/fltini.hxx b/sw/source/filter/inc/fltini.hxx index b3758cdcb5c5..d74d2615d53c 100644 --- a/sw/source/filter/inc/fltini.hxx +++ b/sw/source/filter/inc/fltini.hxx @@ -34,7 +34,7 @@ class HTMLReader: public Reader // wir wollen die Streams / Storages nicht geoeffnet haben virtual int SetStrmStgPtr(); virtual sal_uLong Read(SwDoc &, const String& rBaseURL, SwPaM &,const String &); - virtual String GetTemplateName() const; + virtual String GetTemplateName(SwDoc& rDoc) const; public: HTMLReader(); }; |