Skip to content

Commit

Permalink
Minor improvements
Browse files Browse the repository at this point in the history
* Calling stream.copyto only if length check passes
* Adding Document Format module via nget
  • Loading branch information
4F2E4A2E committed Jul 28, 2015
1 parent 0d1e9f3 commit 0ee4e7e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
6 changes: 5 additions & 1 deletion docxmerger/DocxMerger.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
Expand All @@ -24,7 +25,6 @@
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
Expand Down Expand Up @@ -53,6 +53,10 @@
<StartupObject>DocxMerger.Program</StartupObject>
</PropertyGroup>
<ItemGroup>
<Reference Include="DocumentFormat.OpenXml, Version=2.5.5631.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\DocumentFormat.OpenXml.2.5\lib\DocumentFormat.OpenXml.dll</HintPath>
</Reference>
<Reference Include="OpenXmlPowerTools">
<HintPath>..\packages\OpenXmlPowerTools.3.1.09\lib\OpenXmlPowerTools.dll</HintPath>
</Reference>
Expand Down
2 changes: 1 addition & 1 deletion docxmerger/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ static void mergeDocx(string paramOutputFile, List<FileStream> paramDocumentstre
foreach (var stream in paramDocumentstreams)
{
var tempms = new MemoryStream();
stream.CopyTo(tempms);

if (0 != stream.Length)
{
stream.CopyTo(tempms);
WmlDocument doc = new WmlDocument(stream.Length.ToString(), tempms);
sources.Add(new Source(doc, true));
}
Expand Down
4 changes: 2 additions & 2 deletions docxmerger/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.1")]
[assembly: AssemblyFileVersion("1.0.0.1")]
[assembly: AssemblyVersion("1.0.0.2")]
[assembly: AssemblyFileVersion("1.0.0.2")]
1 change: 1 addition & 0 deletions docxmerger/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="DocumentFormat.OpenXml" version="2.5" targetFramework="net45" />
<package id="OpenXmlPowerTools" version="3.1.09" targetFramework="net40" />
</packages>

0 comments on commit 0ee4e7e

Please sign in to comment.