Commits

Anonymous committed 65930a7

CWS-TOOLING: integrate CWS os120

Comments (0)

Files changed (15)

filter/source/pdf/pdfexport.cxx

 #include <com/sun/star/frame/XModel.hpp>
 #include <com/sun/star/frame/XModuleManager.hpp>
 #include <com/sun/star/frame/XStorable.hpp>
+#include <com/sun/star/frame/XController.hpp>
 #include <com/sun/star/document/XDocumentProperties.hpp>
 #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
 #include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/view/XViewSettingsSupplier.hpp>
 #include <unotools/configmgr.hxx>
 #include <com/sun/star/lang/XServiceInfo.hpp>
 #include <com/sun/star/drawing/XShapes.hpp>
                     break;
             }
 
+            //get model
+            Reference< frame::XModel > xModel( mxSrcDoc, UNO_QUERY );
 			{
 //---> i56629 Relative link stuff				
 //set the base URL of the file:
-//get model
-				Reference< frame::XModel > xModel( mxSrcDoc, UNO_QUERY );
 //then base URL
 				aContext.BaseURL = xModel->getURL();
 //relative link option is private to PDF Export filter and limited to local filesystem only
 					aSelection <<= mxSrcDoc;
 				}
 				sal_Bool		bSecondPassForImpressNotes = sal_False;
+				bool bReChangeToNormalView = false;
+              	::rtl::OUString sShowOnlineLayout( RTL_CONSTASCII_USTRINGPARAM( "ShowOnlineLayout"));
+              	uno::Reference< beans::XPropertySet > xViewProperties;
+				
+				if ( aCreator.EqualsAscii( "Writer" ) )
+				{
+				    //i92835 if Writer is in web layout mode this has to be switched to normal view and back to web view in the end
+                    try
+                    {
+                        Reference< view::XViewSettingsSupplier > xVSettingsSupplier( xModel->getCurrentController(), uno::UNO_QUERY_THROW );
+                        xViewProperties =  xVSettingsSupplier->getViewSettings();
+                    	xViewProperties->getPropertyValue( sShowOnlineLayout ) >>= bReChangeToNormalView;
+                    	if( bReChangeToNormalView )
+                    	{
+                    	    xViewProperties->setPropertyValue( sShowOnlineLayout, uno::makeAny( false ) );
+                    	}
+                    }
+                    catch( const uno::Exception& )
+                    {
+                    }
+                    	
+				}
+				
                 const sal_Int32 nPageCount = xRenderable->getRendererCount( aSelection, aRenderOptions );
 				const Range     aRange( 1, nPageCount );
 				MultiSelection  aMultiSelection;
                     aErrors = pPDFWriter->GetErrors();
 				}
 				pOut->SetExtOutDevData( NULL );
+                if( bReChangeToNormalView )
+                {
+                    try
+                    {
+                        xViewProperties->setPropertyValue( sShowOnlineLayout, uno::makeAny( true ) );
+                    }
+                    catch( const uno::Exception& )
+                    {
+                    }
+                }
 			}
+			
 			delete pPDFExtOutDevData;
             delete pPDFWriter;
         }
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.