1. mst
  2. ooo340

Commits

obo  committed 99aa868

CWS-TOOLING: integrate CWS impresshtmlex01
2009-01-23 14:32:03 +0100 cl r266820 : CWS-TOOLING: rebase CWS impresshtmlex01 to trunk@266428 (milestone: DEV300:m39)
2009-01-08 14:35:38 +0100 cl r266008 : #i95504# allow custom image sizes over API
2009-01-08 14:17:47 +0100 cl r266007 : #i16295# export directionality for paragraphs
2009-01-06 15:34:07 +0100 cl r265924 : CWS-TOOLING: rebase CWS impresshtmlex01 to trunk@265758 (milestone: DEV300:m38)

  • Participants
  • Parent commits f195f06
  • Branches default

Comments (0)

Files changed (2)

File sd/source/filter/html/htmlex.cxx

View file
  • Ignore whitespace
 //#ifndef _SVDETC_HXX
 //#include <svx/svdetc.hxx>
 //#endif
+#include <svx/frmdiritem.hxx>
 #include <svx/svdoutl.hxx>
 #include <svx/impgrf.hxx>				// FillFilter()
 #include <tools/urlobj.hxx>               // INetURLObject
 // class HtmlExport Methoden
 // *********************************************************************
 
+static String getParagraphStyle( SdrOutliner* pOutliner, USHORT nPara )
+{
+    SfxItemSet aParaSet( pOutliner->GetParaAttribs( nPara ) );
+    
+    String sStyle( RTL_CONSTASCII_USTRINGPARAM("direction:") );
+    if( static_cast<const SvxFrameDirectionItem*>(aParaSet.GetItem( EE_PARA_WRITINGDIR ))->GetValue() == FRMDIR_HORI_RIGHT_TOP )
+    {
+        sStyle += String( RTL_CONSTASCII_USTRINGPARAM("rtl;") );
+    }
+    else
+    {
+         sStyle += String( RTL_CONSTASCII_USTRINGPARAM("ltr;") );
+    }
+    return sStyle;
+}
 
 // =====================================================================
 // Konstruktor fuer die Html Export Hilfsklasse
 	Size aTmpSize( pPage->GetSize() );
 	double dRatio=((double)aTmpSize.Width())/aTmpSize.Height();
 
+/*
 	switch( mnWidthPixel )
 	{
 		case 800:
 			mnWidthPixel = 512;
 			break;
 	}
+*/
 	mnHeightPixel = (USHORT)(mnWidthPixel/dRatio);
 
 	//------------------------------------------------------------------
 		aStr += CreateNavBar(nSdPage, true);
 
 // Seitentitel
-		aStr.AppendAscii( "<h1>" );
-		aStr += CreateTextForTitle(pOutliner,pPage, pPage->GetPageBackgroundColor());
+        String sTitleText( CreateTextForTitle(pOutliner,pPage, pPage->GetPageBackgroundColor()) );
+		aStr.AppendAscii( "<h1 style=\"");
+        aStr.Append( getParagraphStyle( pOutliner, 0 ) );
+        aStr.AppendAscii( "\">" );
+		aStr += sTitleText;
 		aStr.AppendAscii( "</h1>\r\n" );
 
 // Gliederungstext schreiben
 					{
 						aStr.AppendAscii( "</ul>" );
 						nActDepth--;
-						if( nActDepth >= 0 )
-							aStr.AppendAscii( "</li>" );
 					}
 					while(nDepth < nActDepth);
 				}
 				{
 					do
 					{
-						if( nActDepth >= 0 )
-							aStr.AppendAscii( "<li>" );
 						aStr.AppendAscii( "<ul>" );
 						nActDepth++;
 					}
 					while( nDepth > nActDepth );
 				}
 
+                String sStyle( getParagraphStyle( pOutliner, nPara ) );
 				if(nActDepth >= 0 )
-					aStr.AppendAscii( "<li>" );
-				if(nActDepth == 0 && bHeadLine)
-					aStr.AppendAscii( "<h2>" );
+                {
+					aStr.AppendAscii( "<li style=\"");
+                    aStr.Append( sStyle );
+                    aStr.AppendAscii( "\">" );
+                }
+				
+                if(nActDepth <= 0 && bHeadLine)
+                {
+                    if( nActDepth == 0 )
+                    {
+					    aStr.AppendAscii( "<h2>" );
+                    }
+                    else
+                    {
+					    aStr.AppendAscii( "<h2 style=\"");
+                        aStr.Append( sStyle );
+                        aStr.AppendAscii( "\">" );
+                    }
+                }
 				aStr += aParaText;
 				if(nActDepth == 0 && bHeadLine)
 					aStr.AppendAscii( "</h2>" );
 			{
 				aStr.AppendAscii( "</ul>" );
 				nActDepth--;
-				if( nActDepth >= 0 )
-					aStr.AppendAscii( "</li>" );
 			};
 		}
 	}
 			ULONG nCount = pOutliner->GetParagraphCount();
 			for (ULONG nPara = 0; nPara < nCount; nPara++)
 			{
+                aStr.AppendAscii("<p style=\"");
+                aStr.Append( getParagraphStyle( pOutliner, nPara ) );
+                aStr.AppendAscii("\">");
 				aStr += ParagraphToHTMLString( pOutliner, nPara,rBackgroundColor );
-				aStr.AppendAscii( "<br>\r\n" );
+				aStr.AppendAscii( "</p>\r\n" );
 			}
 		}
 	}
 			String aTitle = CreateTextForTitle(pOutliner,pPage, maBackColor);
 			if(aTitle.Len() == 0)
 				aTitle = *mpPageNames[nSdPage];
+
+            aStr.AppendAscii("<p style=\"");
+            aStr.Append( getParagraphStyle( pOutliner, 0 ) );
+            aStr.AppendAscii("\">");
 			aStr += CreateLink(aLink, aTitle);
+            aStr.AppendAscii("</p>");
 
 			if(nPage==1)
 			{
-				aStr.AppendAscii( "<br>" );
 				aStr += CreateTextForPage( pOutliner, pPage, false, maBackColor );
 			}
 			aStr.AppendAscii( "</div>\r\n" );

File sd/source/filter/html/pubdlg.cxx

View file
  • Ignore whitespace
 	// Page 3
 
 	aValue.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Width" ) );
-	aValue.Value <<= (sal_Int32)( pPage3_Resolution_1->IsChecked()?PUB_LOWRES_WIDTH:
-								 pPage3_Resolution_2->IsChecked()?PUB_MEDRES_WIDTH:PUB_HIGHRES_WIDTH);
+    sal_Int32 nTmpWidth = 512;
+    if( pPage3_Resolution_2->IsChecked() )
+        nTmpWidth = 640;
+    else if( pPage3_Resolution_3->IsChecked() )
+        nTmpWidth = 800;
+
+	aValue.Value <<= nTmpWidth;
 	aProps.push_back( aValue );
 
 	aValue.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "Compression" ) );