summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorGokce Kuler <gokcekuler@gmail.com>2021-07-05 01:02:59 +0300
committerGülşah Köse <gulsah.kose@collabora.com>2021-07-07 08:21:20 +0200
commit070a5b039b181c380b1b9724a015314ff78c30ed (patch)
treefba891d69e73803d620800b2dd3f79b2e0251005 /editeng
parent0759191e6923945469bc426b2c322ddeade12e09 (diff)
tdf#57585 Add new bullet behaviour to impress
Added the feature of removing bullets from blank lines and showing the bullet in a faded color on lines that have not yet added text. Change-Id: Ifb3beed7a0127d85660842555c85ceb466258441 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118450 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/editdoc.cxx8
-rw-r--r--editeng/source/outliner/outliner.cxx8
2 files changed, 16 insertions, 0 deletions
diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx
index 2a7f43032245..99a7e22fbdc9 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -2258,6 +2258,9 @@ EditPaM EditDoc::InsertParaBreak( EditPaM aPaM, bool bKeepEndingAttribs )
// for a new paragraph we like to have the bullet/numbering visible by default
aContentAttribs.GetItems().Put( SfxBoolItem( EE_PARA_BULLETSTATE, true) );
+ if(aPaM.GetNode()->Len() == 0)
+ aPaM.GetNode()->GetContentAttribs().GetItems().Put( SfxBoolItem(EE_PARA_BULLETSTATE, false));
+
// ContentNode constructor copies also the paragraph attributes
ContentNode* pNode = new ContentNode( aStr, aContentAttribs );
@@ -2307,6 +2310,11 @@ EditPaM EditDoc::InsertFeature( EditPaM aPaM, const SfxPoolItem& rItem )
EditPaM EditDoc::ConnectParagraphs( ContentNode* pLeft, ContentNode* pRight )
{
const EditPaM aPaM( pLeft, pLeft->Len() );
+ if(pLeft->Len()==0)
+ {
+ EditPaM aCopyPaM(aPaM);
+ aCopyPaM.GetNode()->GetContentAttribs().GetItems().Put( SfxBoolItem(EE_PARA_BULLETSTATE, true));
+ }
// First the attributes, otherwise nLen will not be correct!
pLeft->AppendAttribs( pRight );
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx
index 9c474131352c..49ac38415987 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -867,6 +867,8 @@ vcl::Font Outliner::ImpCalcBulletFont( sal_Int32 nPara ) const
aBulletFont.SetOrientation( Degree10(bVertical ? (IsTopToBottom() ? 2700 : 900) : 0) );
Color aColor( COL_AUTO );
+ OUString sText = GetText(GetParagraph(nPara));
+
if( !pEditEngine->IsFlatMode() && !( pEditEngine->GetControlWord() & EEControlBits::NOCOLORS ) )
{
aColor = pFmt->GetBulletColor();
@@ -875,6 +877,12 @@ vcl::Font Outliner::ImpCalcBulletFont( sal_Int32 nPara ) const
if ( ( aColor == COL_AUTO ) || ( IsForceAutoColor() ) )
aColor = pEditEngine->GetAutoColor();
+ if( sText.getLength()>0)
+ aColor.SetAlpha(255);
+
+ else
+ aColor.SetAlpha(95);
+
aBulletFont.SetColor( aColor );
return aBulletFont;
}