PageObjectLayouter can be held by unique_ptr
Change-Id: I3323ca198d534d673772e7cdc10f04a12e6f9376 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187213 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins
This commit is contained in:
@@ -66,7 +66,7 @@ public:
|
||||
const std::shared_ptr<Theme>& rpTheme);
|
||||
~Layouter();
|
||||
|
||||
std::shared_ptr<PageObjectLayouter> const & GetPageObjectLayouter() const;
|
||||
PageObjectLayouter* GetPageObjectLayouter() const;
|
||||
/** Set the interval of valid column counts. When nMinimalColumnCount
|
||||
<= nMaximalColumnCount is not fulfilled then the call is ignored.
|
||||
@param nMinimalColumnCount
|
||||
|
||||
@@ -383,8 +383,7 @@ void SlideSorterView::Layout ()
|
||||
pWindow->SetViewOrigin (aViewBox.TopLeft());
|
||||
pWindow->SetViewSize (aViewBox.GetSize());
|
||||
|
||||
std::shared_ptr<PageObjectLayouter> pPageObjectLayouter(
|
||||
mpLayouter->GetPageObjectLayouter());
|
||||
PageObjectLayouter* pPageObjectLayouter(mpLayouter->GetPageObjectLayouter());
|
||||
if (pPageObjectLayouter)
|
||||
{
|
||||
const Size aNewPreviewSize (mpLayouter->GetPageObjectLayouter()->GetPreviewSize());
|
||||
|
||||
@@ -105,7 +105,7 @@ void InsertionIndicatorOverlay::Create (
|
||||
const sal_Int32 nSelectionCount)
|
||||
{
|
||||
view::Layouter& rLayouter (mrSlideSorter.GetView().GetLayouter());
|
||||
const std::shared_ptr<view::PageObjectLayouter>& pPageObjectLayouter (
|
||||
view::PageObjectLayouter* pPageObjectLayouter (
|
||||
rLayouter.GetPageObjectLayouter());
|
||||
std::shared_ptr<view::Theme> pTheme (mrSlideSorter.GetTheme());
|
||||
const Size aOriginalPreviewSize (pPageObjectLayouter->GetPreviewSize());
|
||||
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
/// rows.
|
||||
sal_Int32 mnMaxRowCount;
|
||||
Size maPageObjectSize;
|
||||
std::shared_ptr<PageObjectLayouter> mpPageObjectLayouter;
|
||||
std::unique_ptr<PageObjectLayouter> mpPageObjectLayouter;
|
||||
std::shared_ptr<view::Theme> mpTheme;
|
||||
|
||||
/** Specify how the gap between two page objects is associated with the
|
||||
@@ -303,9 +303,9 @@ Layouter::~Layouter()
|
||||
{
|
||||
}
|
||||
|
||||
std::shared_ptr<PageObjectLayouter> const & Layouter::GetPageObjectLayouter() const
|
||||
PageObjectLayouter* Layouter::GetPageObjectLayouter() const
|
||||
{
|
||||
return mpImplementation->mpPageObjectLayouter;
|
||||
return mpImplementation->mpPageObjectLayouter.get();
|
||||
}
|
||||
|
||||
void Layouter::SetColumnCount (
|
||||
@@ -517,7 +517,7 @@ bool Layouter::Implementation::Rearrange (
|
||||
}
|
||||
|
||||
mpPageObjectLayouter =
|
||||
std::make_shared<PageObjectLayouter>(
|
||||
std::make_unique<PageObjectLayouter>(
|
||||
CalculateTargetSize(rWindowSize),
|
||||
rPreviewModelSize,
|
||||
mpWindow,
|
||||
|
||||
@@ -67,7 +67,7 @@ void PageObjectPainter::PaintPageObject (
|
||||
if (!UpdatePageObjectLayouter())
|
||||
return;
|
||||
|
||||
PageObjectLayouter *pPageObjectLayouter = mrLayouter.GetPageObjectLayouter().get();
|
||||
PageObjectLayouter *pPageObjectLayouter = mrLayouter.GetPageObjectLayouter();
|
||||
// Turn off antialiasing to avoid the bitmaps from being
|
||||
// shifted by fractions of a pixel and thus show blurry edges.
|
||||
const AntialiasingFlags nSavedAntialiasingMode (rDevice.GetAntialiasing());
|
||||
@@ -86,7 +86,7 @@ bool PageObjectPainter::UpdatePageObjectLayouter()
|
||||
{
|
||||
// The page object layouter is quite volatile. It may have been replaced
|
||||
// since the last call. Update it now.
|
||||
PageObjectLayouter *pPageObjectLayouter = mrLayouter.GetPageObjectLayouter().get();
|
||||
PageObjectLayouter *pPageObjectLayouter = mrLayouter.GetPageObjectLayouter();
|
||||
if ( ! pPageObjectLayouter)
|
||||
{
|
||||
OSL_FAIL("no page object layouter");
|
||||
@@ -185,7 +185,7 @@ BitmapEx PageObjectPainter::GetPreviewBitmap (
|
||||
|
||||
if (bIsExcluded)
|
||||
{
|
||||
PageObjectLayouter *pPageObjectLayouter = mrLayouter.GetPageObjectLayouter().get();
|
||||
PageObjectLayouter *pPageObjectLayouter = mrLayouter.GetPageObjectLayouter();
|
||||
|
||||
BitmapEx aMarkedPreview (mpCache->GetMarkedPreviewBitmap(pPage));
|
||||
const ::tools::Rectangle aPreviewBox (pPageObjectLayouter->GetBoundingBox(
|
||||
|
||||
Reference in New Issue
Block a user