forked from dbzhang800/QtXlsxWriter
-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add suport of print area and page setup #31
Open
drow-it
wants to merge
9
commits into
VSRonin:master
Choose a base branch
from
drow-it:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
851e14d
Add suport of print area and page setup
drow-it 1c3ff28
Formatting
drow-it cb32934
Fixing errors
drow-it 40de369
Page breaks and multiline text
tavplubix f88d38f
Merge pull request #1 from tavplubix/master
drow-it 52d8224
Fix PageSetup
tavplubix a7eb6bb
Merge pull request #2 from tavplubix/master
drow-it c470e91
Changes to compile on Qt 5.14.1
drow-it da6437c
Исправление ошибки открытия сгенерированного файла
drow-it File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -228,13 +228,23 @@ void SharedStrings::saveToXmlFile(QIODevice *device) const | |
writer.writeStartElement(QStringLiteral("si")); | ||
if (string.isRichString()) { | ||
//Rich text string | ||
Format lastNotEmptyFragmentFormat; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change is unrelated to the pull request. Not a big deal but next time please try to keep them separated |
||
for (int i=0; i<string.fragmentCount(); ++i) { | ||
writer.writeStartElement(QStringLiteral("r")); | ||
if (string.fragmentFormat(i).hasFontData()) { | ||
Format fragmentFormat = string.fragmentFormat(i); | ||
if (string.fragmentText(i).trimmed().isEmpty() && !fragmentFormat.hasFontData()) { | ||
// Fragment contains only spaces and doesn't have font data. | ||
// Excel will set default font for this fragment. | ||
// It's better to set font of last fragment, which contains some text. | ||
fragmentFormat = lastNotEmptyFragmentFormat; | ||
} | ||
if (fragmentFormat.hasFontData()) { | ||
writer.writeStartElement(QStringLiteral("rPr")); | ||
writeRichStringPart_rPr(writer, string.fragmentFormat(i)); | ||
writeRichStringPart_rPr(writer, fragmentFormat); | ||
writer.writeEndElement();// rPr | ||
} | ||
lastNotEmptyFragmentFormat = fragmentFormat; | ||
|
||
writer.writeStartElement(QStringLiteral("t")); | ||
if (isSpaceReserveNeeded(string.fragmentText(i))) | ||
writer.writeAttribute(QStringLiteral("xml:space"), QStringLiteral("preserve")); | ||
|
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Document the public methods x2