/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
if (!aVisArea.IsEmpty()) // not when opening
{
mrNotesPanelViewShell.InitWindows(Point(0, 0), aVisArea.GetSize(), aVisArea.TopLeft(), true);
mrNotesPanelViewShell.UpdateScrollBars();
}
}
void NotesPanelView::onGrabFocus()
{ if (mbInFocus) return;
mbInFocus = true;
SdrTextObj* pNotesTextObj = getNotesTextObj(); if (pNotesTextObj && pNotesTextObj->IsEmptyPresObj())
{ // clear the "Click to add Notes" text on entering the window.
maOutliner.SetToEmptyText();
}
}
void NotesPanelView::onLoseFocus()
{ if (!mbInFocus) return;
mbInFocus = false;
aModifyIdle.Stop();
SdrTextObj* pNotesTextObj = getNotesTextObj(); if (pNotesTextObj)
{ if (!maOutliner.GetEditEngine().HasText())
{ // if the notes are empty restore the placeholder text and state.
SdPage* pPage = dynamic_cast<SdPage*>(pNotesTextObj->getSdrPageFromSdrObject()); if (pPage)
pPage->RestoreDefaultText(pNotesTextObj);
} else
setNotesToDoc();
}
}
IMPL_LINK_NOARG(NotesPanelView, EditModifiedHdl, LinkParamNone*, void)
{ // EditEngine calls ModifyHdl many times in succession for some edits. // (e.g. when deleting multiple lines) // Debounce the rapid ModifyHdl calls using a timer.
aModifyIdle.Start(); return;
}
/** * Set attributes of the selected text
*/ bool NotesPanelView::SetAttributes(const SfxItemSet& rSet, bool/*bSlide*/, bool /*bReplaceAll*/, bool/*bMaster*/)
{ bool bOk = false;
OutlinerView* pOlView = GetOutlinerView();
if (pOlView)
{
pOlView->SetAttribs(rSet);
bOk = true;
}
/** * Get attributes of the selected text
*/ void NotesPanelView::GetAttributes(SfxItemSet& rTargetSet, bool) const
{
rTargetSet.Put(const_cast<OutlinerView&>(maOutlinerView).GetAttribs(), false);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.