11#include <GraphicSizeCheck.hxx>
12#include <svx/strings.hrc>
30 : m_pGraphicNode(pGraphicNode)
32 constexpr double fLowPercentage = 110;
33 constexpr double fHighPercentage = 50;
44 Size aFrameSize(pFrameFormat->GetFrameSize().GetSize());
68 std::vector<std::unique_ptr<GraphicSizeViolation>>& m_rGraphicSizeViolationList;
71 GraphicSizeCheckHandler(
73 std::vector<std::unique_ptr<GraphicSizeViolation>>& rGraphicSizeViolationList)
75 , m_rGraphicSizeViolationList(rGraphicSizeViolationList)
79 void handleNode(
SwNode* pNode)
override
84 auto pEntry = std::make_unique<GraphicSizeViolation>(m_nDPI, pNode->
GetGrfNode());
87 m_rGraphicSizeViolationList.push_back(std::move(pEntry));
91 void handleSdrObject(
SdrObject* )
override {}
114 sText =
SwResId(STR_WARNING_GRAPHIC_PIXEL_COUNT_LOW);
118 sText =
SwResId(STR_WARNING_GRAPHIC_PIXEL_COUNT_HIGH);
121 sText = sText.replaceAll(
"%NAME%",
m_pViolation->getGraphicName());
122 sText = sText.replaceAll(
"%DPIX%", OUString::number(
m_pViolation->getDPIX()));
123 sText = sText.replaceAll(
"%DPIY%", OUString::number(
m_pViolation->getDPIY()));
139 SfxCallMode::SYNCHRON);
151 = std::make_unique<GraphicSizeCheckGUIEntry>(pDocument, std::move(rpViolation));
152 rCollection.push_back(std::move(rGUIEntry));
158 return SwResId(STR_GRAPHIC_SIZE_CHECK_DIALOG_TITLE);
Size GetSizePixel(const OutputDevice *pRefDevice=nullptr) const
virtual sal_Int32 getImagePreferredDPI()=0
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
SfxDispatcher * GetDispatcher()
SfxViewFrame & GetViewFrame() const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
SwWrtShell * GetWrtShell()
Access to the SwWrtShell belonging to SwView.
IDocumentSettingAccess const & getIDocumentSettingAccess() const
SwDocShell * GetDocShell()
Graphic GetGraphic() const
Base class of the Writer document model elements.
SwFrameFormat * GetFlyFormat() const
If node is in a fly return the respective format.
Used by the UI to modify the document model.
bool GotoFly(const OUString &rName, FlyCntType eType=FLYCNTTYPE_ALL, bool bSelFrame=true)
const SwView & GetView() const
std::vector< std::unique_ptr< CheckData > > & getCollection()
std::unique_ptr< GraphicSizeViolation > m_pViolation
OUString getText() override
void markObject() override
void runProperties() override
OUString getTitle() override
GraphicSizeCheckGUIResult(SwDoc *pDocument)
Run the graphic size checks for all the graphic objects in the DOM and store a list of violations.
std::vector< std::unique_ptr< GraphicSizeViolation > > & getViolationList()
std::vector< std::unique_ptr< GraphicSizeViolation > > m_aGraphicSizeViolationList
const OUString & getGraphicName()
sal_Int32 m_nHighDPILimit
GraphicSizeViolation(sal_Int32 nDPI, const SwGrfNode *pGraphicNode)
const SwGrfNode * m_pGraphicNode
void addNodeHandler(std::shared_ptr< ModelTraverseHandler > pHandler)
#define FN_FORMAT_GRAFIC_DLG
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
Dialog to specify the properties of date form field.
OUString SwResId(TranslateId aId)