Skip to content

Commit 7a1c792

Browse files
committed
Issue with Word 2010. Add relative paths support
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.
1 parent 364ffd7 commit 7a1c792

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

main.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,15 @@ int main(int argc, char *argv[])
112112
return -1;
113113
}
114114

115-
return convert(inputFile, outputFile, parser.isSet(landscapeOption)) ? 0 : -1;
115+
{
116+
const QString inputFilePathForConvert = QDir::toNativeSeparators(inputFileInfo.absoluteFilePath());
117+
const QString outputFilePathForConvert = QDir::toNativeSeparators(outputFileInfo.absoluteFilePath());
118+
119+
return convert(inputFilePathForConvert,
120+
outputFilePathForConvert,
121+
parser.isSet(landscapeOption)) ?
122+
0 : -1;
123+
}
116124
}else {
117125
std::cout << "ERROR: Paths to the input and output files are required!" << std::endl;
118126
return -1;

0 commit comments

Comments
 (0)