xref: /aoo41x/main/sfx2/source/bastyp/frmhtmlw.cxx (revision d119d52d)
1*d119d52dSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*d119d52dSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*d119d52dSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*d119d52dSAndrew Rist  * distributed with this work for additional information
6*d119d52dSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*d119d52dSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*d119d52dSAndrew Rist  * "License"); you may not use this file except in compliance
9*d119d52dSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*d119d52dSAndrew Rist  *
11*d119d52dSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*d119d52dSAndrew Rist  *
13*d119d52dSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*d119d52dSAndrew Rist  * software distributed under the License is distributed on an
15*d119d52dSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*d119d52dSAndrew Rist  * KIND, either express or implied.  See the License for the
17*d119d52dSAndrew Rist  * specific language governing permissions and limitations
18*d119d52dSAndrew Rist  * under the License.
19*d119d52dSAndrew Rist  *
20*d119d52dSAndrew Rist  *************************************************************/
21*d119d52dSAndrew Rist 
22*d119d52dSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_sfx2.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #ifndef _INETDEF_HXX
28cdf0e10cSrcweir #include <svl/inetdef.hxx>
29cdf0e10cSrcweir #endif
30cdf0e10cSrcweir #include "svtools/htmlkywd.hxx"
31cdf0e10cSrcweir 
32cdf0e10cSrcweir //!(dv) #include <chaos2/cntapi.hxx>
33cdf0e10cSrcweir #include <rtl/tencinfo.h>
34cdf0e10cSrcweir 
35cdf0e10cSrcweir #include <unotools/configmgr.hxx>
36cdf0e10cSrcweir #include "svl/urihelper.hxx"
37cdf0e10cSrcweir #include <tools/datetime.hxx>
38cdf0e10cSrcweir 
39cdf0e10cSrcweir #include <sfx2/frmhtmlw.hxx>
40cdf0e10cSrcweir #include <sfx2/evntconf.hxx>
41cdf0e10cSrcweir #include <sfx2/frame.hxx>
42cdf0e10cSrcweir #include <sfx2/app.hxx>
43cdf0e10cSrcweir #include <sfx2/viewfrm.hxx>
44cdf0e10cSrcweir #include <sfx2/docfile.hxx>
45cdf0e10cSrcweir #include "sfx2/sfxresid.hxx"
46cdf0e10cSrcweir #include <sfx2/objsh.hxx>
47cdf0e10cSrcweir #include <sfx2/sfx.hrc>
48cdf0e10cSrcweir #include "bastyp.hrc"
49cdf0e10cSrcweir 
50cdf0e10cSrcweir #include <comphelper/string.hxx>
51cdf0e10cSrcweir #include <comphelper/processfactory.hxx>
52cdf0e10cSrcweir 
53cdf0e10cSrcweir #include <com/sun/star/script/XTypeConverter.hpp>
54cdf0e10cSrcweir #include <com/sun/star/document/XDocumentProperties.hpp>
55cdf0e10cSrcweir 
56cdf0e10cSrcweir 
57cdf0e10cSrcweir // -----------------------------------------------------------------------
58cdf0e10cSrcweir 
59cdf0e10cSrcweir using namespace ::com::sun::star;
60cdf0e10cSrcweir 
61cdf0e10cSrcweir static sal_Char __READONLY_DATA sHTML_SC_yes[] =	"YES";
62cdf0e10cSrcweir static sal_Char __READONLY_DATA sHTML_SC_no[] =		"NO";
63cdf0e10cSrcweir static sal_Char __READONLY_DATA sHTML_SC_auto[] =	"AUTO";
64cdf0e10cSrcweir static sal_Char __READONLY_DATA sHTML_MIME_text_html[] =	"text/html; charset=";
65cdf0e10cSrcweir 
66cdf0e10cSrcweir /* not used anymore?
67cdf0e10cSrcweir static HTMLOutEvent __FAR_DATA aFrameSetEventTable[] =
68cdf0e10cSrcweir {
69cdf0e10cSrcweir 	{ sHTML_O_SDonload,		sHTML_O_onload,		SFX_EVENT_OPENDOC	},
70cdf0e10cSrcweir 	{ sHTML_O_SDonunload,	sHTML_O_onunload,	SFX_EVENT_PREPARECLOSEDOC	},
71cdf0e10cSrcweir 	{ sHTML_O_SDonfocus,	sHTML_O_onfocus,	SFX_EVENT_ACTIVATEDOC	},
72cdf0e10cSrcweir 	{ sHTML_O_SDonblur,		sHTML_O_onblur,		SFX_EVENT_DEACTIVATEDOC	},
73cdf0e10cSrcweir 	{ 0,					0,				  	0					}
74cdf0e10cSrcweir };
75cdf0e10cSrcweir */
76cdf0e10cSrcweir 
77cdf0e10cSrcweir #if defined(UNX)
78cdf0e10cSrcweir const sal_Char SfxFrameHTMLWriter::sNewLine[] = "\012";
79cdf0e10cSrcweir #else
80cdf0e10cSrcweir const sal_Char __FAR_DATA SfxFrameHTMLWriter::sNewLine[] = "\015\012";
81cdf0e10cSrcweir #endif
82cdf0e10cSrcweir 
OutMeta(SvStream & rStrm,const sal_Char * pIndent,const String & rName,const String & rContent,sal_Bool bHTTPEquiv,rtl_TextEncoding eDestEnc,String * pNonConvertableChars)83cdf0e10cSrcweir void SfxFrameHTMLWriter::OutMeta( SvStream& rStrm,
84cdf0e10cSrcweir 								  const sal_Char *pIndent,
85cdf0e10cSrcweir 								  const String& rName,
86cdf0e10cSrcweir 								  const String& rContent, sal_Bool bHTTPEquiv,
87cdf0e10cSrcweir 							   	  rtl_TextEncoding eDestEnc,
88cdf0e10cSrcweir 								  String *pNonConvertableChars	)
89cdf0e10cSrcweir {
90cdf0e10cSrcweir 	rStrm << sNewLine;
91cdf0e10cSrcweir 	if( pIndent )
92cdf0e10cSrcweir 		rStrm << pIndent;
93cdf0e10cSrcweir 
94cdf0e10cSrcweir 	ByteString sOut( '<' );
95cdf0e10cSrcweir 	(((sOut += OOO_STRING_SVTOOLS_HTML_meta) += ' ')
96cdf0e10cSrcweir 		+= (bHTTPEquiv ? OOO_STRING_SVTOOLS_HTML_O_httpequiv : OOO_STRING_SVTOOLS_HTML_O_name))	+= "=\"";
97cdf0e10cSrcweir 	rStrm << sOut.GetBuffer();
98cdf0e10cSrcweir 
99cdf0e10cSrcweir 	HTMLOutFuncs::Out_String( rStrm, rName, eDestEnc, pNonConvertableChars );
100cdf0e10cSrcweir 
101cdf0e10cSrcweir 	((sOut = "\" ") += OOO_STRING_SVTOOLS_HTML_O_content) += "=\"";
102cdf0e10cSrcweir 	rStrm << sOut.GetBuffer();
103cdf0e10cSrcweir 
104cdf0e10cSrcweir 	HTMLOutFuncs::Out_String( rStrm, rContent, eDestEnc, pNonConvertableChars ) << "\">";
105cdf0e10cSrcweir }
106cdf0e10cSrcweir 
Out_DocInfo(SvStream & rStrm,const String & rBaseURL,const uno::Reference<document::XDocumentProperties> & i_xDocProps,const sal_Char * pIndent,rtl_TextEncoding eDestEnc,String * pNonConvertableChars)107cdf0e10cSrcweir void SfxFrameHTMLWriter::Out_DocInfo( SvStream& rStrm, const String& rBaseURL,
108cdf0e10cSrcweir         const uno::Reference<document::XDocumentProperties> & i_xDocProps,
109cdf0e10cSrcweir 		const sal_Char *pIndent,
110cdf0e10cSrcweir         rtl_TextEncoding eDestEnc,
111cdf0e10cSrcweir 		String *pNonConvertableChars	)
112cdf0e10cSrcweir {
113cdf0e10cSrcweir 	const sal_Char *pCharSet =
114cdf0e10cSrcweir 				rtl_getBestMimeCharsetFromTextEncoding( eDestEnc );
115cdf0e10cSrcweir 
116cdf0e10cSrcweir 	if( pCharSet )
117cdf0e10cSrcweir 	{
118cdf0e10cSrcweir 		String aContentType = String::CreateFromAscii( sHTML_MIME_text_html );
119cdf0e10cSrcweir 		aContentType.AppendAscii( pCharSet );
120cdf0e10cSrcweir 		OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_content_type, aContentType, sal_True,
121cdf0e10cSrcweir                  eDestEnc, pNonConvertableChars );
122cdf0e10cSrcweir 	}
123cdf0e10cSrcweir 
124cdf0e10cSrcweir 	// Titel (auch wenn er leer ist)
125cdf0e10cSrcweir 	rStrm << sNewLine;
126cdf0e10cSrcweir 	if( pIndent )
127cdf0e10cSrcweir 		rStrm << pIndent;
128cdf0e10cSrcweir 	HTMLOutFuncs::Out_AsciiTag( rStrm, OOO_STRING_SVTOOLS_HTML_title );
129cdf0e10cSrcweir 	if( i_xDocProps.is() )
130cdf0e10cSrcweir 	{
131cdf0e10cSrcweir 		const String& rTitle = i_xDocProps->getTitle();
132cdf0e10cSrcweir 		if( rTitle.Len() )
133cdf0e10cSrcweir 			HTMLOutFuncs::Out_String( rStrm, rTitle, eDestEnc, pNonConvertableChars );
134cdf0e10cSrcweir 	}
135cdf0e10cSrcweir 	HTMLOutFuncs::Out_AsciiTag( rStrm, OOO_STRING_SVTOOLS_HTML_title, sal_False );
136cdf0e10cSrcweir 
137cdf0e10cSrcweir 	// Target-Frame
138cdf0e10cSrcweir 	if( i_xDocProps.is() )
139cdf0e10cSrcweir 	{
140cdf0e10cSrcweir 		const String& rTarget = i_xDocProps->getDefaultTarget();
141cdf0e10cSrcweir 		if( rTarget.Len() )
142cdf0e10cSrcweir 		{
143cdf0e10cSrcweir 			rStrm << sNewLine;
144cdf0e10cSrcweir 			if( pIndent )
145cdf0e10cSrcweir 				rStrm << pIndent;
146cdf0e10cSrcweir 
147cdf0e10cSrcweir 			ByteString sOut( '<' );
148cdf0e10cSrcweir 			(((sOut += OOO_STRING_SVTOOLS_HTML_base) += ' ') += OOO_STRING_SVTOOLS_HTML_O_target) += "=\"";
149cdf0e10cSrcweir 			rStrm << sOut.GetBuffer();
150cdf0e10cSrcweir 			HTMLOutFuncs::Out_String( rStrm, rTarget, eDestEnc, pNonConvertableChars )
151cdf0e10cSrcweir 				<< "\">";
152cdf0e10cSrcweir 		}
153cdf0e10cSrcweir 	}
154cdf0e10cSrcweir 
155cdf0e10cSrcweir 	// Who we are
156cdf0e10cSrcweir 	String sGenerator( SfxResId( STR_HTML_GENERATOR ) );
157cdf0e10cSrcweir 	sGenerator.SearchAndReplaceAscii( "%1", String( DEFINE_CONST_UNICODE( TOOLS_INETDEF_OS ) ) );
158cdf0e10cSrcweir 	OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_generator, sGenerator, sal_False, eDestEnc, pNonConvertableChars );
159cdf0e10cSrcweir 
160cdf0e10cSrcweir 	if( i_xDocProps.is() )
161cdf0e10cSrcweir 	{
162cdf0e10cSrcweir 		// Reload
163cdf0e10cSrcweir         if( (i_xDocProps->getAutoloadSecs() != 0) ||
164cdf0e10cSrcweir             !i_xDocProps->getAutoloadURL().equalsAscii("") )
165cdf0e10cSrcweir 		{
166cdf0e10cSrcweir 			String sContent = String::CreateFromInt32(
167cdf0e10cSrcweir 								i_xDocProps->getAutoloadSecs() );
168cdf0e10cSrcweir 
169cdf0e10cSrcweir 			const String &rReloadURL = i_xDocProps->getAutoloadURL();
170cdf0e10cSrcweir 			if( rReloadURL.Len() )
171cdf0e10cSrcweir 			{
172cdf0e10cSrcweir 				sContent.AppendAscii( ";URL=" );
173cdf0e10cSrcweir                 sContent += String(
174cdf0e10cSrcweir                     URIHelper::simpleNormalizedMakeRelative(
175cdf0e10cSrcweir                         rBaseURL, rReloadURL));
176cdf0e10cSrcweir 			}
177cdf0e10cSrcweir 
178cdf0e10cSrcweir 			OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_refresh, sContent, sal_True,
179cdf0e10cSrcweir                      eDestEnc, pNonConvertableChars );
180cdf0e10cSrcweir 		}
181cdf0e10cSrcweir 
182cdf0e10cSrcweir 		// Author
183cdf0e10cSrcweir 		const String& rAuthor = i_xDocProps->getAuthor();
184cdf0e10cSrcweir 		if( rAuthor.Len() )
185cdf0e10cSrcweir 			OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_author, rAuthor, sal_False,
186cdf0e10cSrcweir                      eDestEnc, pNonConvertableChars );
187cdf0e10cSrcweir 
188cdf0e10cSrcweir 		// created
189cdf0e10cSrcweir         ::util::DateTime uDT = i_xDocProps->getCreationDate();
190cdf0e10cSrcweir         Date aD(uDT.Day, uDT.Month, uDT.Year);
191cdf0e10cSrcweir         Time aT(uDT.Hours, uDT.Minutes, uDT.Seconds, uDT.HundredthSeconds);
192cdf0e10cSrcweir         String sOut = String::CreateFromInt32(aD.GetDate());
193cdf0e10cSrcweir         sOut += ';';
194cdf0e10cSrcweir         sOut += String::CreateFromInt32(aT.GetTime());
195cdf0e10cSrcweir 		OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_created, sOut, sal_False,
196cdf0e10cSrcweir                  eDestEnc, pNonConvertableChars );
197cdf0e10cSrcweir 
198cdf0e10cSrcweir 		// changedby
199cdf0e10cSrcweir 		const String& rChangedBy = i_xDocProps->getModifiedBy();
200cdf0e10cSrcweir 		if( rChangedBy.Len() )
201cdf0e10cSrcweir 			OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_changedby, rChangedBy, sal_False,
202cdf0e10cSrcweir                      eDestEnc, pNonConvertableChars );
203cdf0e10cSrcweir 
204cdf0e10cSrcweir 		// changed
205cdf0e10cSrcweir         uDT = i_xDocProps->getModificationDate();
206cdf0e10cSrcweir         Date aD2(uDT.Day, uDT.Month, uDT.Year);
207cdf0e10cSrcweir         Time aT2(uDT.Hours, uDT.Minutes, uDT.Seconds, uDT.HundredthSeconds);
208cdf0e10cSrcweir         sOut = String::CreateFromInt32(aD2.GetDate());
209cdf0e10cSrcweir         sOut += ';';
210cdf0e10cSrcweir         sOut += String::CreateFromInt32(aT2.GetTime());
211cdf0e10cSrcweir 		OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_changed, sOut, sal_False,
212cdf0e10cSrcweir                  eDestEnc, pNonConvertableChars );
213cdf0e10cSrcweir 
214cdf0e10cSrcweir 		// Subject
215cdf0e10cSrcweir 		const String& rTheme = i_xDocProps->getSubject();
216cdf0e10cSrcweir 		if( rTheme.Len() )
217cdf0e10cSrcweir 			OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_classification, rTheme, sal_False,
218cdf0e10cSrcweir                      eDestEnc, pNonConvertableChars );
219cdf0e10cSrcweir 
220cdf0e10cSrcweir 		// Description
221cdf0e10cSrcweir 		const String& rComment = i_xDocProps->getDescription();
222cdf0e10cSrcweir 		if( rComment.Len() )
223cdf0e10cSrcweir 			OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_description, rComment, sal_False,
224cdf0e10cSrcweir                      eDestEnc, pNonConvertableChars);
225cdf0e10cSrcweir 
226cdf0e10cSrcweir 		// Keywords
227cdf0e10cSrcweir 		String Keywords = ::comphelper::string::convertCommaSeparated(
228cdf0e10cSrcweir             i_xDocProps->getKeywords());
229cdf0e10cSrcweir 		if( Keywords.Len() )
230cdf0e10cSrcweir 			OutMeta( rStrm, pIndent, OOO_STRING_SVTOOLS_HTML_META_keywords, Keywords, sal_False,
231cdf0e10cSrcweir                      eDestEnc, pNonConvertableChars);
232cdf0e10cSrcweir 
233cdf0e10cSrcweir         uno::Reference < script::XTypeConverter > xConverter(
234cdf0e10cSrcweir             ::comphelper::getProcessServiceFactory()->createInstance(
235cdf0e10cSrcweir                 ::rtl::OUString::createFromAscii("com.sun.star.script.Converter")),
236cdf0e10cSrcweir                 uno::UNO_QUERY_THROW );
237cdf0e10cSrcweir         uno::Reference<beans::XPropertySet> xUserDefinedProps(
238cdf0e10cSrcweir             i_xDocProps->getUserDefinedProperties(), uno::UNO_QUERY_THROW);
239cdf0e10cSrcweir         DBG_ASSERT(xUserDefinedProps.is(), "UserDefinedProperties is null");
240cdf0e10cSrcweir         uno::Reference<beans::XPropertySetInfo> xPropInfo =
241cdf0e10cSrcweir             xUserDefinedProps->getPropertySetInfo();
242cdf0e10cSrcweir         DBG_ASSERT(xPropInfo.is(), "UserDefinedProperties Info is null");
243cdf0e10cSrcweir         uno::Sequence<beans::Property> props = xPropInfo->getProperties();
244cdf0e10cSrcweir         for (sal_Int32 i = 0; i < props.getLength(); ++i) {
245cdf0e10cSrcweir             try {
246cdf0e10cSrcweir                 ::rtl::OUString name = props[i].Name;
247cdf0e10cSrcweir                 ::rtl::OUString str;
248cdf0e10cSrcweir                 uno::Any aStr = xConverter->convertToSimpleType(
249cdf0e10cSrcweir                         xUserDefinedProps->getPropertyValue(name),
250cdf0e10cSrcweir                         uno::TypeClass_STRING);
251cdf0e10cSrcweir                 aStr >>= str;
252cdf0e10cSrcweir                 String valstr(str);
253cdf0e10cSrcweir                 valstr.EraseTrailingChars();
254cdf0e10cSrcweir                 OutMeta( rStrm, pIndent, name, valstr, sal_False,
255cdf0e10cSrcweir                          eDestEnc, pNonConvertableChars );
256cdf0e10cSrcweir             } catch (uno::Exception &) {
257cdf0e10cSrcweir                 // may happen with concurrent modification...
258cdf0e10cSrcweir                 DBG_WARNING("SfxFrameHTMLWriter::Out_DocInfo: exception");
259cdf0e10cSrcweir             }
260cdf0e10cSrcweir         }
261cdf0e10cSrcweir 	}
262cdf0e10cSrcweir }
263cdf0e10cSrcweir /*
264cdf0e10cSrcweir void SfxFrameHTMLWriter::OutHeader( rtl_TextEncoding eDestEnc )
265cdf0e10cSrcweir {
266cdf0e10cSrcweir 	// <HTML>
267cdf0e10cSrcweir 	// <HEAD>
268cdf0e10cSrcweir 	// <TITLE>Titel</TITLE>
269cdf0e10cSrcweir 	// </HEAD>
270cdf0e10cSrcweir 	HTMLOutFuncs::Out_AsciiTag( Strm(), sHTML_html ) << sNewLine;
271cdf0e10cSrcweir 	HTMLOutFuncs::Out_AsciiTag( Strm(), sHTML_head );
272cdf0e10cSrcweir 
273cdf0e10cSrcweir 	Out_DocInfo( Strm(), &pDoc->GetDocInfo(), "\t", eDestEnc );
274cdf0e10cSrcweir 	Strm() << sNewLine;
275cdf0e10cSrcweir 	HTMLOutFuncs::Out_AsciiTag( Strm(), sHTML_head, sal_False ) << sNewLine;
276cdf0e10cSrcweir 
277cdf0e10cSrcweir //!	OutScript();			// Hier fehlen noch die Scripten im Header
278cdf0e10cSrcweir }
279cdf0e10cSrcweir */
280cdf0e10cSrcweir 
Out_FrameDescriptor(SvStream & rOut,const String & rBaseURL,const uno::Reference<beans::XPropertySet> & xSet,rtl_TextEncoding eDestEnc,String * pNonConvertableChars)281cdf0e10cSrcweir void SfxFrameHTMLWriter::Out_FrameDescriptor(
282cdf0e10cSrcweir     SvStream& rOut, const String& rBaseURL, const uno::Reference < beans::XPropertySet >& xSet,
283cdf0e10cSrcweir     rtl_TextEncoding eDestEnc, String *pNonConvertableChars )
284cdf0e10cSrcweir {
285cdf0e10cSrcweir     try
286cdf0e10cSrcweir     {
287cdf0e10cSrcweir         ByteString sOut;
288cdf0e10cSrcweir         ::rtl::OUString aStr;
289cdf0e10cSrcweir         uno::Any aAny = xSet->getPropertyValue( ::rtl::OUString::createFromAscii("FrameURL") );
290cdf0e10cSrcweir         if ( (aAny >>= aStr) && aStr.getLength() )
291cdf0e10cSrcweir         {
292cdf0e10cSrcweir             String aURL = INetURLObject( aStr ).GetMainURL( INetURLObject::DECODE_TO_IURI );
293cdf0e10cSrcweir             if( aURL.Len() )
294cdf0e10cSrcweir             {
295cdf0e10cSrcweir                 aURL = URIHelper::simpleNormalizedMakeRelative(
296cdf0e10cSrcweir                     rBaseURL, aURL );
297cdf0e10cSrcweir                 ((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_src) += "=\"";
298cdf0e10cSrcweir                 rOut << sOut.GetBuffer();
299cdf0e10cSrcweir                 HTMLOutFuncs::Out_String( rOut, aURL, eDestEnc, pNonConvertableChars );
300cdf0e10cSrcweir                 sOut = '\"';
301cdf0e10cSrcweir             }
302cdf0e10cSrcweir         }
303cdf0e10cSrcweir 
304cdf0e10cSrcweir         aAny = xSet->getPropertyValue( ::rtl::OUString::createFromAscii("FrameName") );
305cdf0e10cSrcweir         if ( (aAny >>= aStr) && aStr.getLength() )
306cdf0e10cSrcweir         {
307cdf0e10cSrcweir             ((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_name) += "=\"";
308cdf0e10cSrcweir             rOut << sOut.GetBuffer();
309cdf0e10cSrcweir             HTMLOutFuncs::Out_String( rOut, aStr, eDestEnc, pNonConvertableChars );
310cdf0e10cSrcweir             sOut = '\"';
311cdf0e10cSrcweir         }
312cdf0e10cSrcweir 
313cdf0e10cSrcweir         sal_Int32 nVal = SIZE_NOT_SET;
314cdf0e10cSrcweir         aAny = xSet->getPropertyValue( ::rtl::OUString::createFromAscii("FrameMarginWidth") );
315cdf0e10cSrcweir         if ( (aAny >>= nVal) && nVal != SIZE_NOT_SET )
316cdf0e10cSrcweir             (((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_marginwidth) += '=') += ByteString::CreateFromInt32( nVal );
317cdf0e10cSrcweir         aAny = xSet->getPropertyValue( ::rtl::OUString::createFromAscii("FrameMarginHeight") );
318cdf0e10cSrcweir         if ( (aAny >>= nVal) && nVal != SIZE_NOT_SET )
319cdf0e10cSrcweir             (((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_marginheight) += '=') += ByteString::CreateFromInt32( nVal );
320cdf0e10cSrcweir 
321cdf0e10cSrcweir         sal_Bool bVal = sal_True;
322cdf0e10cSrcweir         aAny = xSet->getPropertyValue( ::rtl::OUString::createFromAscii("FrameIsAutoScroll") );
323cdf0e10cSrcweir         if ( (aAny >>= bVal) && !bVal )
324cdf0e10cSrcweir         {
325cdf0e10cSrcweir             aAny = xSet->getPropertyValue( ::rtl::OUString::createFromAscii("FrameIsScrollingMode") );
326cdf0e10cSrcweir             if ( aAny >>= bVal )
327cdf0e10cSrcweir             {
328cdf0e10cSrcweir                 const sal_Char *pStr = bVal ? sHTML_SC_yes : sHTML_SC_no;
329cdf0e10cSrcweir                 (((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_scrolling) += '=') += pStr;
330cdf0e10cSrcweir             }
331cdf0e10cSrcweir         }
332cdf0e10cSrcweir 
333cdf0e10cSrcweir         // frame border (MS+Netscape-Erweiterung)
334cdf0e10cSrcweir         aAny = xSet->getPropertyValue( ::rtl::OUString::createFromAscii("FrameIsAutoBorder") );
335cdf0e10cSrcweir         if ( (aAny >>= bVal) && !bVal )
336cdf0e10cSrcweir         {
337cdf0e10cSrcweir             aAny = xSet->getPropertyValue( ::rtl::OUString::createFromAscii("FrameIsBorder") );
338cdf0e10cSrcweir             if ( aAny >>= bVal )
339cdf0e10cSrcweir             {
340cdf0e10cSrcweir                 const char* pStr = bVal ? sHTML_SC_yes : sHTML_SC_no;
341cdf0e10cSrcweir                 (((sOut += ' ') += OOO_STRING_SVTOOLS_HTML_O_frameborder) += '=') += pStr;
342cdf0e10cSrcweir             }
343cdf0e10cSrcweir         }
344cdf0e10cSrcweir 
345cdf0e10cSrcweir         // TODO/LATER: currently not supported attributes
346cdf0e10cSrcweir         // resize
347cdf0e10cSrcweir         //if( !pFrame->IsResizable() )
348cdf0e10cSrcweir         //    (sOut += ' ') += sHTML_O_noresize;
349cdf0e10cSrcweir         //
350cdf0e10cSrcweir         //if ( pFrame->GetWallpaper() )
351cdf0e10cSrcweir         //{
352cdf0e10cSrcweir         //    ((sOut += ' ') += sHTML_O_bordercolor) += '=';
353cdf0e10cSrcweir         //    rOut << sOut.GetBuffer();
354cdf0e10cSrcweir         //    HTMLOutFuncs::Out_Color( rOut, pFrame->GetWallpaper()->GetColor(), eDestEnc );
355cdf0e10cSrcweir         //}
356cdf0e10cSrcweir         //else
357cdf0e10cSrcweir             rOut << sOut.GetBuffer();
358cdf0e10cSrcweir     }
359cdf0e10cSrcweir     catch ( uno::Exception& )
360cdf0e10cSrcweir     {
361cdf0e10cSrcweir     }
362cdf0e10cSrcweir }
363cdf0e10cSrcweir 
CreateURL(SfxFrame * pFrame)364cdf0e10cSrcweir String SfxFrameHTMLWriter::CreateURL( SfxFrame* pFrame )
365cdf0e10cSrcweir {
366cdf0e10cSrcweir 	String aRet;
367cdf0e10cSrcweir 	SfxObjectShell* pShell = pFrame->GetCurrentDocument();
368cdf0e10cSrcweir 	if( !aRet.Len() && pShell )
369cdf0e10cSrcweir 	{
370cdf0e10cSrcweir 		aRet = pShell->GetMedium()->GetName();
371cdf0e10cSrcweir //!(dv)		CntAnchor::ToPresentationURL( aRet );
372cdf0e10cSrcweir 	}
373cdf0e10cSrcweir 
374cdf0e10cSrcweir 	return aRet;
375cdf0e10cSrcweir }
376cdf0e10cSrcweir 
377cdf0e10cSrcweir 
378