feat: [xps] enable dual-page and sidebar support with robust scaling#201
Merged
deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom Nov 13, 2025
Merged
feat: [xps] enable dual-page and sidebar support with robust scaling#201deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
Conversation
lzwind
approved these changes
Nov 13, 2025
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: LiHua000, lzwind The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Contributor
|
TAG Bot New tag: 6.5.42 |
- safeguard SheetBrowser’s fit logic against zero-sized page metrics to keep dual-page mode stable for XPS documents - initialise XPS DocSheets with the standard thumbnail/catalog/bookmark sidebar - allow TitleWidget controls (sidebar toggle, zoom menu) for XPS files now that the underlying features are wired - keep XPS render path improvements aligned with existing viewer behaviour task: https://pms.uniontech.com/task-view-383459.html
deepin pr auto review我来对这段代码进行详细审查:
bool supportedType = (Dr::PDF == m_sheet->fileType());
#ifdef XPS_SUPPORT_ENABLED
supportedType = supportedType || (Dr::XPS == m_sheet->fileType());
#endif优点:
建议:
const qreal safeMaxWidth = qFuzzyIsNull(m_maxWidth) ? 1.0 : m_maxWidth;
const qreal safeMaxHeight = qFuzzyIsNull(m_maxHeight) ? (qFuzzyIsNull(m_maxWidth) ? 1.0 : m_maxWidth) : m_maxHeight;优点:
建议:
if (logicalSize.isEmpty() || logicalSize.width() <= 0.0 || logicalSize.height() <= 0.0) {
qCWarning(appLog) << "Invalid logical size for XPS page" << logicalSize;
return QImage();
}优点:
建议:
#ifdef XPS_SUPPORT_ENABLED
else if (Dr::XPS == fileType)
m_sidebar = new SheetSidebar(this, PREVIEW_THUMBNAIL | PREVIEW_CATALOG | PREVIEW_BOOKMARK);
#endif优点:
建议:
if (Dr::PDF == m_curSheet->fileType()
|| Dr::DOCX == m_curSheet->fileType()
#ifdef XPS_SUPPORT_ENABLED
|| Dr::XPS == m_curSheet->fileType()
#endif
) {优点:
建议:
总体建议:
这些改进主要提高了代码的安全性、可维护性和可扩展性,同时修复了一些潜在的问题。 |
Contributor
Author
|
/forcemerge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
task: https://pms.uniontech.com/task-view-383459.html