Skip to content

Commit

Permalink
Issue with Word 2010. Add relative paths support
Browse files Browse the repository at this point in the history
Word 2010 is only compitable with paths like "C:\xxx",
not "C:/xxx". So you have to use QDir::toNativeSeparators
to convert the path.

The path for input/output files can be relative path now.
  • Loading branch information
metorm committed Jul 4, 2018
1 parent 364ffd7 commit 7a1c792
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,15 @@ int main(int argc, char *argv[])
return -1;
}

return convert(inputFile, outputFile, parser.isSet(landscapeOption)) ? 0 : -1;
{
const QString inputFilePathForConvert = QDir::toNativeSeparators(inputFileInfo.absoluteFilePath());
const QString outputFilePathForConvert = QDir::toNativeSeparators(outputFileInfo.absoluteFilePath());

return convert(inputFilePathForConvert,
outputFilePathForConvert,
parser.isSet(landscapeOption)) ?
0 : -1;
}
}else {
std::cout << "ERROR: Paths to the input and output files are required!" << std::endl;
return -1;
Expand Down

0 comments on commit 7a1c792

Please sign in to comment.