summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2023-12-19 16:37:09 -0900
committerJim Raykowski <raykowj@gmail.com>2023-12-21 21:45:23 +0100
commit4c2c900970d6484c6a92900213ece5c415e40f2d (patch)
tree7fc6568a53bc46ded9304a77110cd318296e11af /sw
parente760dcf43052212952191ccdadbfb677fea3b5b8 (diff)
tdf#158114 SwNavigator: Make images with broken links easier to find
This patch makes an icon display in image entries with broken links to make it easier to find images with broken links. Change-Id: I470c9959e169d4cc53a44e0a64e88af35e671db0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161045 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/bitmaps.hlst1
-rw-r--r--sw/source/uibase/utlui/content.cxx22
2 files changed, 20 insertions, 3 deletions
diff --git a/sw/inc/bitmaps.hlst b/sw/inc/bitmaps.hlst
index 50682d32ebc9..b1f30b0932f1 100644
--- a/sw/inc/bitmaps.hlst
+++ b/sw/inc/bitmaps.hlst
@@ -84,6 +84,7 @@ inline constexpr OUString RID_BMP_NAVI_TABLE = u"sw/res/nc20001.png"_ustr;
inline constexpr OUString RID_BMP_NAVI_FRAME = u"sw/res/nc20002.png"_ustr;
inline constexpr OUString RID_BMP_NAVI_GRAPHIC = u"sw/res/nc20003.png"_ustr;
inline constexpr OUString RID_BMP_NAVI_GRAPHIC_LINK = u"sw/res/nc20007.png"_ustr;
+inline constexpr OUString RID_BMP_NAVI_GRAPHIC_BROKENLINK = u"sw/res/brokenlink.png"_ustr;
inline constexpr OUString RID_BMP_NAVI_OLE = u"sw/res/nc20004.png"_ustr;
inline constexpr OUString RID_BMP_NAVI_BOOKMARK = u"sw/res/nc20005.png"_ustr;
inline constexpr OUString RID_BMP_NAVI_REGION = u"sw/res/nc20006.png"_ustr;
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index 4ee3c315e4df..f182eee59cf1 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -121,6 +121,8 @@
#include <docufld.hxx>
+#include <svl/fstathelper.hxx>
+
#define CTYPE_CNT 0
#define CTYPE_CTT 1
@@ -593,7 +595,8 @@ void SwContentType::FillMemberList(bool* pbContentChanged)
if(ContentTypeId::GRAPHIC == m_nContentType)
{
OUString sLink;
- m_pWrtShell->GetGrfNms( &sLink, nullptr, static_cast<const SwFlyFrameFormat*>( pFrameFormat));
+ SwDoc::GetGrfNms(*static_cast<const SwFlyFrameFormat*>(pFrameFormat), &sLink,
+ nullptr);
pCnt = new SwGraphicContent(this, sFrameName, INetURLObject::decode(sLink,
INetURLObject::DecodeMechanism::Unambiguous), nYPos);
}
@@ -2179,8 +2182,21 @@ void SwContentTree::InsertContent(const weld::TreeIter& rParent)
OUString sId(weld::toId(pCnt));
insert(&rParent, sEntry, sId, false, xChild.get());
m_xTreeView->set_sensitive(*xChild, !pCnt->IsInvisible());
- if (bGraphic && !static_cast<const SwGraphicContent*>(pCnt)->GetLink().isEmpty())
- m_xTreeView->set_image(*xChild, RID_BMP_NAVI_GRAPHIC_LINK);
+ if (bGraphic)
+ {
+ const OUString& rsURL = static_cast<const SwGraphicContent*>(pCnt)->GetLink();
+ if (!rsURL.isEmpty())
+ {
+ if (FStatHelper::IsDocument(rsURL))
+ {
+ m_xTreeView->set_image(*xChild, RID_BMP_NAVI_GRAPHIC_LINK);
+ }
+ else
+ {
+ m_xTreeView->set_image(*xChild, RID_BMP_NAVI_GRAPHIC_BROKENLINK);
+ }
+ }
+ }
}
}