diff options
author | Tomaž Vajngerl <quikee@gmail.com> | 2012-12-09 22:41:45 +0100 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2012-12-09 22:43:06 +0100 |
commit | 815f40a6ca428867d4c31249bf0eb8075f050158 (patch) | |
tree | bf8ebd19002dcbd053e5a89e8aa1f1d9a1b07e0c | |
parent | fdb7fe63db5ba17036a71fe4f7f25f834bef8f95 (diff) |
Reformat code in PreviewRenderer.
Change-Id: Ia17c14a0bf3908fb9201996b64b5c1059ada3205
-rw-r--r-- | sd/source/ui/tools/PreviewRenderer.cxx | 109 |
1 files changed, 54 insertions, 55 deletions
diff --git a/sd/source/ui/tools/PreviewRenderer.cxx b/sd/source/ui/tools/PreviewRenderer.cxx index 5d2761753c6b..9aaa5b482ef5 100644 --- a/sd/source/ui/tools/PreviewRenderer.cxx +++ b/sd/source/ui/tools/PreviewRenderer.cxx @@ -231,67 +231,62 @@ bool PreviewRenderer::Initialize ( const Size& rPixelSize, const bool bObeyHighContrastMode) { - bool bSuccess = false; - do - { - if (pPage == NULL) - break; + if (pPage == NULL) + return false; - SdrModel* pModel = pPage->GetModel(); - if (pModel == NULL) - break; + SdrModel* pModel = pPage->GetModel(); + if (pModel == NULL) + return false; - SetupOutputSize(*pPage, rPixelSize); + SetupOutputSize(*pPage, rPixelSize); - SdDrawDocument* pDocument - = static_cast<SdDrawDocument*>(pPage->GetModel()); - DrawDocShell* pDocShell = pDocument->GetDocSh(); + SdDrawDocument* pDocument + = static_cast<SdDrawDocument*>(pPage->GetModel()); + DrawDocShell* pDocShell = pDocument->GetDocSh(); - // Create view - ProvideView (pDocShell); - if (mpView.get() == NULL) - break; - - // Adjust contrast mode. - bool bUseContrast (bObeyHighContrastMode - && Application::GetSettings().GetStyleSettings().GetHighContrastMode()); - mpPreviewDevice->SetDrawMode (bUseContrast - ? ViewShell::OUTPUT_DRAWMODE_CONTRAST - : ViewShell::OUTPUT_DRAWMODE_COLOR); - mpPreviewDevice->SetSettings(Application::GetSettings()); - - // Tell the view to show the given page. - SdPage* pNonConstPage = const_cast<SdPage*>(pPage); - if (pPage->IsMasterPage()) - { - mpView->ShowSdrPage(mpView->GetModel()->GetMasterPage(pPage->GetPageNum())); - } - else - { - mpView->ShowSdrPage(pNonConstPage); - } - - // Make sure that a page view exists. - SdrPageView* pPageView = mpView->GetSdrPageView(); - if (pPageView == NULL) - break; - // Set background color of page view and outliner. - svtools::ColorConfig aColorConfig; - const Color aPageBackgroundColor(pPage->GetPageBackgroundColor(pPageView)); - pPageView->SetApplicationBackgroundColor(aPageBackgroundColor); - SdrOutliner& rOutliner (pDocument->GetDrawOutliner(NULL)); - rOutliner.SetBackgroundColor(aPageBackgroundColor); - rOutliner.SetDefaultLanguage(pDocument->GetLanguage(EE_CHAR_LANGUAGE)); - mpView->SetApplicationBackgroundColor( - Color(aColorConfig.GetColorValue(svtools::APPBACKGROUND).nColor)); - mpPreviewDevice->SetBackground(Wallpaper(aPageBackgroundColor)); - mpPreviewDevice->Erase(); - - bSuccess = true; + // Create view + ProvideView (pDocShell); + if (mpView.get() == NULL) + return false; + + // Adjust contrast mode. + bool bUseContrast (bObeyHighContrastMode + && Application::GetSettings().GetStyleSettings().GetHighContrastMode()); + mpPreviewDevice->SetDrawMode (bUseContrast + ? ViewShell::OUTPUT_DRAWMODE_CONTRAST + : ViewShell::OUTPUT_DRAWMODE_COLOR); + mpPreviewDevice->SetSettings(Application::GetSettings()); + + // Tell the view to show the given page. + SdPage* pNonConstPage = const_cast<SdPage*>(pPage); + if (pPage->IsMasterPage()) + { + mpView->ShowSdrPage(mpView->GetModel()->GetMasterPage(pPage->GetPageNum())); + } + else + { + mpView->ShowSdrPage(pNonConstPage); } - while (false); - return bSuccess; + // Make sure that a page view exists. + SdrPageView* pPageView = mpView->GetSdrPageView(); + + if (pPageView == NULL) + return false; + + // Set background color of page view and outliner. + svtools::ColorConfig aColorConfig; + const Color aPageBackgroundColor(pPage->GetPageBackgroundColor(pPageView)); + pPageView->SetApplicationBackgroundColor(aPageBackgroundColor); + SdrOutliner& rOutliner (pDocument->GetDrawOutliner(NULL)); + rOutliner.SetBackgroundColor(aPageBackgroundColor); + rOutliner.SetDefaultLanguage(pDocument->GetLanguage(EE_CHAR_LANGUAGE)); + mpView->SetApplicationBackgroundColor( + Color(aColorConfig.GetColorValue(svtools::APPBACKGROUND).nColor)); + mpPreviewDevice->SetBackground(Wallpaper(aPageBackgroundColor)); + mpPreviewDevice->Erase(); + + return true; } @@ -453,6 +448,10 @@ void PreviewRenderer::ProvideView (DrawDocShell* pDocShell) mpView->SetPageVisible(false); mpView->SetPageBorderVisible(true); mpView->SetBordVisible(false); + mpView->SetGridVisible(false); + mpView->SetHlplVisible(false); + mpView->SetGlueVisible(false); + #else // This works in the slide sorter but prevents the master page // background being painted in the list of current master pages in the |