summaryrefslogtreecommitdiff
path: root/sfx2/source/doc
diff options
context:
space:
mode:
Diffstat (limited to 'sfx2/source/doc')
-rw-r--r--sfx2/source/doc/objserv.cxx33
1 files changed, 20 insertions, 13 deletions
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 7485cfe04a5f..1bee627d11d6 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -1058,21 +1058,28 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet)
break;
}
- if ( pFrame->HasInfoBarWithID("signature") )
- pFrame->RemoveInfoBar("signature");
-
- if ( eState != SignatureState::NOSIGNATURES )
+ // new info bar
+ if ( !pFrame->HasInfoBarWithID("signature") )
+ {
+ if ( !sMessage.isEmpty() )
+ {
+ auto pInfoBar = pFrame->AppendInfoBar("signature", sMessage, aInfoBarType);
+ if (pInfoBar == nullptr)
+ return;
+ VclPtrInstance<PushButton> xBtn(&(pFrame->GetWindow()));
+ xBtn->SetText(SfxResId(STR_SIGNATURE_SHOW));
+ xBtn->SetSizePixel(xBtn->GetOptimalSize());
+ xBtn->SetClickHdl(LINK(this, SfxObjectShell, SignDocumentHandler));
+ pInfoBar->addButton(xBtn);
+ }
+ }
+ else // info bar exists already
{
- auto pInfoBar = pFrame->AppendInfoBar("signature", sMessage, aInfoBarType);
- if (pInfoBar == nullptr)
- return;
- VclPtrInstance<PushButton> xBtn(&(pFrame->GetWindow()));
- xBtn->SetText(SfxResId(STR_SIGNATURE_SHOW));
- xBtn->SetSizePixel(xBtn->GetOptimalSize());
- xBtn->SetClickHdl(LINK(this, SfxObjectShell, SignDocumentHandler));
- pInfoBar->addButton(xBtn);
+ if ( eState == SignatureState::NOSIGNATURES )
+ pFrame->RemoveInfoBar("signature");
+ else
+ pFrame->UpdateInfoBar("signature", sMessage, aInfoBarType);
}
-
}
rSet.Put( SfxUInt16Item( SID_SIGNATURE, static_cast<sal_uInt16>(GetDocumentSignatureState()) ) );